|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9230 PHP cannot connect to remote Oracle databases
Submitted: 2001-02-12 13:03 UTC Modified: 2001-06-12 16:32 UTC
From: mfarver at texas dot net Assigned:
Status: Closed Package: Oracle related
PHP Version: 4.0.4pl1 OS: Win95/NT
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
50 - 9 = ?
Subscribe to this entry?

 [2001-02-12 13:03 UTC] mfarver at texas dot net
$handle = ora_plogon('scott@remotedb','tiger');

Always returns "ORA-12154: TNS:could not resolve service name" or similar errors indicating Oracle is not reading the TNSNAMES.ORA file.  Using sysinternals filemon to watch PHP accessing files shows the same result, the oracle drivers never read tnsnames.ora when called from php.  SQLNET.log files indicate that PHP is always attempting to use the BEQLOCAL protocol adapter regardless of the tnsnames.ora settings.  Adding a ORACLE_SID environment variable caused php to try to connect to that SID at BEQLOCAL.

Users report that Oracle's SQLPLUS and external ODBC programs have no trouble accessing the remote db.  tnsping and other oracle test programs work correctly when called from a php passthru function, indicating that the environment is correct. 

This problem occurs using both OCI and ORACLE functions.

About a half dozen individuals on the php-db list have noted the same problem.  To date no one on the PHP-DB list has claimed to make php work with oracle under windows.  All the users report using php with an oracle 8.x.x client and the precompiled binaries supplied from the main php site. Many variations of ORACLE_HOME and other env variable settings have been tried.  

Under Unix php does not exhibit the same problem..  


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-12 16:32 UTC]
This problem was also seen under the ODBC drivers for Windows.  The solution so far has been to remove all Windows based carriage returns (\r\n) in your TNSNames.ora and SQLNet.ora file, and replace them with unix style carriage returns (\n).

This should end your problem.  Why is this happening?  It's unknown at the time, but is being investigated.  
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Oct 16 04:03:33 2021 UTC