setting OCI8 env vars under NT
| From: | Vince LaMonica | Date: | Tue, 15 Aug 2000 01:45:47 +0000 |
| Subject: | setting OCI8 env vars under NT | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-1790@lists.php.net to get a copy of this message | ||
Hi All,
I want to connect to an Ora 7.3.4 db [on an NT server] using OCI8 [on my
NT laptop] functions via PHP4. I've successfully installed the php4win w/
OCI8 compiled in. However, I get errors when attempting to connect to the
database [error 12203 and 12154].
I've got apache 1.3.12 ssl on this NT box, and I've included the following
in my httpd.conf as it appears to be recommended by others [they state to
edit the apachectl file, however the NT version doesn't use that]:
SetEnv TNS_ADMIN "D:\orant\net80\admin"
SetEnv ORACLE_HOME "D:\orant\net80"
#SetEnv ORACLE_HOME "D:\orant"
#SetEnv ORACLE_SID "D005"
SetEnv TWO_TASK "D005"
[i've gone back and forth with the ORACLE_SID and TWO_TASK & ORACLE_HOME].
I'm using naap's php4.0.2-dev. My php.ini file is nearly unchanged from
the 'optimized' php.ini that comes with the 4.0.2 distribution. My test
php script looks like this:
putenv("TNS_ADMIN=D:\ORANT\NET80\ADMIN");
//putenv("ORACLE_SID=D005");
//putenv("TWO_TASK=D005");
//putenv("ORACLE_HOME D:\ORANT");
//putenv("ORACLE_HOME D:\ORANT\NET80");
//putenv("HOST=HOST2");
//putenv("PORT=1521");
//putenv("PROTOCOL=TCP");
$connection = OCILogon("stat","stat") or die ("Couldn't login");
//$connection = OCILogon("stat","stat","STNEWQ01") or die
("Couldn't login");
My tnsnames.ora file is in the NET80\ADMIN dir. If I attempt to name the
db's alias in the OCILogon function, I get an error 12154:
Warning: _oci_open_server: ORA-12154: TNS:could not resolve service name
If I remove the alias, I get an error 12203:
Warning: _oci_open_server: ORA-12203: TNS:unable to connect to destination
I know that putenv's aren't apparently supposed to be used, as the
environmental vars are supposed to be called in apache; but I attempted to
get this to work using some of the above putenv functions commented out
above.
What am I configuring incorrectly? Is this question better suited for an
apache list? Any tips y'all can throw my way would be very much
appreciated!
Thanks,
/vjl/ [who currently doesn't have the windows tools needed to compile
windows binaries]