PHP4/Apache on Win95 to remote Oracle

From: Date: Thu, 08 Feb 2001 22:10:24 +0000
Subject: PHP4/Apache on Win95 to remote Oracle
Groups: php.db 
Request: Send a blank email to php-db+get-6484@lists.php.net to get a copy of this message
Hi all, Please help. I'm going maaddd trying to figure this out. I've pretty much read all of the online docs and spend countless hours reading through the archives.. I'm running PHP4 and Apache on my Win95 computer. I'm trying to connect to a remote Oracle database. I'm getting a "Warning: _oci_open_server: ORA-12203: TNS:unable to connect to destination ..." error message. Yet I know the environment is ok because I can tnsping the database name and I can connect using SQL Plus to the database. Here's the php code: <?php putenv("ORACLE_SID=MDC6"); putenv("ORACLE_HOME=D:\PROGRA~1\ORAWIN95"); putenv("TNS_ADMIN=D:\PROGRA~1\ORAWIN95\NET80\ADMIN"); $tns = "(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL =TCP)(HOST = njnwkora15.db.pseg.com)(PORT = 1527))) (CONNECT_DATA = (SID =MDC6) ) )"; $connect=OCIPLogon("MDC","MDC",$tns) or die("It's not possible to connect"); $sql = "select * from district"; $result =OCIParse($connect,$sql); OCIExecute($result) or die("It's not possible to query"); echo("<TABLE>"); while(OCIFetch($result)) { $CC = OCIResult($result,1); $CCNome = OCIResult($result,2); echo('<TR><TD>' . $CC . '</TD><TD>' . $CCNome . '</TD></TR>'); } echo("</TABLE>"); ?> I shouldn't need to declase $tns above but I've tried with and without it. I'm also including the ORACLE_SID, ORACLE_HOME and TNS_ADMIN variables in the autoexec.bat so that they are declared as of machine bootup. I also added them to the httpd.conf for Apache configuration like this: SetEnv ORACLE_SID MDC6 SetEnv ORACLE_HOME D:\PROGRA~1\ORAWIN95 SetEnv TNS_ADMIN D:\PROGRA~1\ORAWIN95\NET80\ADMIN Please help.... Before I switch to ASP... Later, Jorge santos@net-lynx.com

« previous php.db (#6484) next »