|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7446 Apache/WinNT/Oracle client 7.3/oracle dll
Submitted: 2000-10-25 04:18 UTC Modified: 2001-06-12 16:30 UTC
From: geert dot hemelsoet dot 211 at B-RAIL dot BE Assigned:
Status: Closed Package: Oracle related
PHP Version: 4.0.3pl1 OS: windows NT 4.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: geert dot hemelsoet dot 211 at B-RAIL dot BE
New email:
PHP Version: OS:


 [2000-10-25 04:18 UTC] geert dot hemelsoet dot 211 at B-RAIL dot BE
Problem: Connecting to a remote Oracle Server with PHP4/ WindowsNT/Apache,extension Oracle

Oracle client 7.3
Apache 1.3.12
php version 4.0.3pl1
server api: cgi
system: windows NT 4.0
activated extension: Oracle(installation of php_oracle.ddl good !, tested) 
2)I have setup the sqlnet.ora and tnsnames.ora files to point to the location of the remote DB:

    (ADDRESS = (PROTOCOL = TCP)(HOST = bca02bruqldb01)(PORT = 1521))

3)With a query tool like WinSQL or MSACCESS the connection to the database works perfect!!!

4)When a try to connect in a phpscript it doesn't work anymore!!
I get the error:
Oracle: Connection Failed: ORA-12154: TNS:could not resolve service name 

5) I also get the following error file SQLnetin the log:
Fatal OSN connect error 12154, connecting to:

	TNS for 32-bit Windows: Version - Production
  Time: 23-OCT-00 09:47:05
  Tracing not turned on.

Fatal OSN connect error 12547, connecting to:

	TNS for 32-bit Windows: Version - Production
	Oracle Bequeath NT Protocol Adapter for 32-bit Windows: Version - Production
  Time: 23-OCT-00 09:47:06
  Tracing not turned on.
  Tns error struct:
    nr err code: 12206
    TNS-12206: TNS:received a TNS error during navigation
    ns main err code: 12547
    TNS-12547: TNS:lost contact
    ns secondary err code: 12560
    nt main err code: 517
    TNS-00517: Lost contact
    nt secondary err code: 0
    nt OS err code: 0

6) What is the solution ?
remark: I have similar problems with ODBC !!!!!

Please give in detail the steps to implement to make it work. I tried already several things.
Give a clear answer !!!!!!

7)Supplementary information:
I also tried to define environment variables for oracle in the httpd.conf

# Apache Oracle environment variables

SetEnv ORACLE_HOME "d:/orant"
SetEnv TNS_ADMIN "d:/orant/network/admin"

But nothing works !!

When I also set the environment variable ORACLE_SID

Then I connect with:  $conn=Ora_Logon("USERNAME","password");

It don't work and I get another error:

ORA-03121 no interface driver connected - function not performed 

explanation of Oracle for this error:

Cause: This message occurs usually because the SQL*Net driver is not loaded into memory or there is a mismatch of the version of the driver. A user program linked with an obsolete library may also cause this message. Only programs provided by Oracle Corporation should use this interface.  
Action: If the message occurred during use of a program provided by Oracle Corporation, contact customer support. If a user program caused the message, relink the program with current versions of the Oracle libraries.  


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-12 16:30 UTC]
the TNS Names error has also been seen in the ODBC section of PHP.  The method found to remove this error has been to edit your SQLNames.ora and TNSNames.ora file to remove all windows carriage returns (\r\n) and replace it with UNIX style carriage returns (\n).

Why?  At this time, it's unknown, but is believed to be a problem with the Oracle or windows drivers.  I believe this fix above should also fix the problem for you!  If not, please re-open the bug.... 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Sep 18 04:03:36 2021 UTC