RE: [PHP-DB] PHP3 Oracle code works, breaks on PHP4 -win32-

From: Date: Sat, 11 Nov 2000 00:32:55 +0000
Subject: RE: [PHP-DB] PHP3 Oracle code works, breaks on PHP4 -win32-
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-4365@lists.php.net to get a copy of this message
Vince: Thanks for the advice, but it gets worse... I'm using IIS, not apache... Arghhh..... And unfortunately, I *have* to use IIS... Any other advice? Maybe the need for Oracle 8.1.6 client is a requirement regardless of the web server? I have access to another NT box w/ the Oracle 8.1.6 client already on it. I can try and test my code there... -Phil -----Original Message----- From: Vince LaMonica [mailto:Vince.LaMonica@quest.com] Sent: Friday, November 10, 2000 5:56 PM To: soko@michonline.com Cc: Andy Hoffman; PHP db list Subject: Re: [PHP-DB] PHP3 Oracle code works, breaks on PHP4 -win32- On 2000-11-10, soko@michonline.com stated: Hi Phil, } 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"); You're super close. I assume you're running apache. If so, add these two lines to your httpd.conf: SetEnv TNS_ADMIN "C:\Program Files\Orant\Network\Admin" SetEnv ORACLE_HOME "C:\Program Files\Orant" Then restart apache. Note a couple of things: The above works for me, though my path is different in that none of the directories have spaces in their names, so that =might= be giving you some problems. Also, for those also looking at the php-windows list, the tutorial on using php4 and apache and oracle under win32 is forthcoming - I promise! [yeah, i know you've heard that before, but things have been quite hectic in my offline life, but that should finally be behind me now]. Lemme know if the above helps... I should also note that 8.1.6 client must be installed on the same PC that apache is running on [even if you're connecting to a 7.3.4 db, as that is my setup as well]. Note that you just need the OCI8 stuff from the Oracle install, though it might take a few attempts to install it [the java installer leaves a bit to be desired]. I have more tips if the above doesn't help... /vjl/

« previous php.db (#4365) next »