ID: 7446
Updated by: kalowsky
Old-Status: Open
Status: Closed
Bug Type: Oracle related
Operating system: 
PHP Version: 4.0.3pl1
Assigned To: 

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.... 

Previous Comments:

[2000-10-25 04:18:03] [EMAIL PROTECTED]
Problem: Connecting to a remote Oracle Server with PHP4/ WindowsNT/Apache,extension 

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 

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 - 
  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 
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.  


ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to