php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10206 PHP in CGI mode fails to perform OCILogon
Submitted: 2001-04-06 08:47 UTC Modified: 2002-02-18 00:00 UTC
From: nick at tf dot kharkov dot net Assigned:
Status: No Feedback Package: OCI8 related
PHP Version: 4.0.4pl1 OS: IIS 4.0, NT Server 4.0 SP6
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2001-04-06 08:47 UTC] nick at tf dot kharkov dot net
When I use php in CGI mode any script can't connect to the Oracle DB throught the OCILogon call.
When I switch to the ISAPI mode these scripts work OK.
the sample script:
<?php
 $dbuser="scott";
 $dbpass="tiger";
 $dbhost="devnt01";
 if (! $dbconn=OCILogon($dbuser,$dbpass,$dbhost)) 
      print("Cannot connect to oracle db '$dbhost' as user '$dbuser'");
?>
oracle reports:
ORA-12154: TNS:could not resolve service name in C:\InetPub\wwwroot\test.php4 on line 5

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-06 11:14 UTC] sniper@php.net
Just wondering if you have all the necessary environment
variables set? Check the manual page http://www.php.net/oci8

--Jani

 [2001-04-11 02:21 UTC] nick at tf dot kharkov dot net
Jani,
php manual suggests to set such enviroment variables:
ORACLE_HOME - seems to be path to a directory where an ORACLE product is. Am I right ?
I've tried to set it as 
SET ORACLE_HOME=C:\ORANT 
and then run php
C:\php4\php.exe c:\InetPub\wwwroot\test.php4
and I've got the same TNS-12154 error :-(
Could you possibly tell, what's is going wrong ?
P.S. I don't have any problems with php3 and Oracle on the same machine.
ORACLE_SID - seems to be SID identifier, TNSNAMES.ORA already has got SID defined for my TNS alias.
LD_PRELOAD - this variable seems to has meaning only for U*NIX systems
LD_LIBRARY_PATH - this variable seems to has meaning only for U*NIX systems
I can't guess what above two variables should contain on Win32 system. Could you possibly enlight me in this issue?
NLS_LANG,ORA_NLS33 - these variables seem to contain NLS settings, so windows registry has it

 [2002-01-13 07:12 UTC] lobbin@php.net
Sounds like an user error, did you get this right? Ff not, please try with latest release 4.1.1.
 [2002-02-18 00:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Oct 27 20:03:34 2021 UTC