PHP3 Oracle code works, breaks on PHP4 -win32-

From: Date: Fri, 10 Nov 2000 22:33:44 +0000
Subject: PHP3 Oracle code works, breaks on PHP4 -win32-
Groups: php.db 
Request: Send a blank email to php-db+get-4362@lists.php.net to get a copy of this message
Hello all, I am having some problems with a PHP4 based application I originally wrote in PHP3. I have php3 (3.0.16) and php4 (4.0.3pl1) installed on the same machine. The platform is win32, and the database backend is Oracle 7.3.4.4.0. I am running php3 and php4 as standalone CGIs. I am trying to connect to the Oracle database via ODBC, but I can't seem to get it working with either the native Oracle functions, OR with ODBC. The strange part is that the application code is unchanged between php version, and when I run the page against my php3 CGI binary, the database functions execute properly. If I run the same code, on the same machine, against the php4 CGI binary, it fails with the an error every time: Warning: Oracle: Connection Failed: ORA-12154: TNS:could not resolve service name Now, I checked my tnsnames.ora file, and it is setup just fine, and my ODBC connection is also fine. (don't forget, this works perfectly with php3, and the unchanged code fails on php4, so I know my connect string is written properly, and I know I can connect to the oracle database...) I tried setting environment varaibles that I thought Oracle would want, such as TNS_ADMIN, and ORACLE_HOME, but no success. I get this error if I try to connect with odbc_connect() or with ora_logon() and both rely on the tnsnames.ora file. This is how I tried to set the variables, and they both show up if I run a phpinfo(). putenv("ORACLE_HOME=C:\Program Files\Orant"); putenv("TNS_ADMIN=C:\Program Files\Orant\Network\Admin"); I also tried the same with double slashes, and with Progra~1 instead of "Program Files" to no avail... Does anyone have any advice? Is there anyone out there running php4 on a win32 system with Oracle as the backend? Please help! PS. I know that I should be using a unix system for this. I always run php under Solaris actually, but this is a special circumstance, and I am limited to Windoze.... :( Thanks, Phil soko@michonline.com

« previous php.db (#4362) next »