PHP4, PWS, Oracle, cannot connect, HELP!

From: Date: Thu, 01 Jun 2000 14:45:25 +0000
Subject: PHP4, PWS, Oracle, cannot connect, HELP!
Groups: php.windows 
Request: Send a blank email to php-windows+get-169@lists.php.net to get a copy of this message
I am running Winnt Workstation 4.0, PWS 4.0, PHP4, and Oracle 8.1.5 (on a different box). I also have PHP3 installed. When I attempt to connect to an Oracle database from PHP3 it works fine. When I attempt to connect to the same database with PHP4, with the exact same code I get this error: Warning: Oracle: Connection Failed: ORA-12154: TNS:could not resolve service name in c:\inetpub\wwwroot\test\oratest.php4 on line 2 Here is my test code: <? $conn = Ora_Logon("msds@tst3.world", "password") or die; $curs = ora_open($conn); ora_commitoff($conn); $query = sprintf("select * from msds"); ora_parse($curs, $query); ora_exec($curs); $ncols = ora_numcols($curs); while (ora_fetch($curs)) { for ($i=0; $i<$ncols; $i++) { printf("%s = %s", ora_columnname($curs,$i), ora_getcolumn($curs,$i)); printf("<br>"); } } ora_close($curs); ora_logoff($conn); ?> I can connect to the database and execute the SQL from SQL-Plus. I *know* that Oracle name resolution works. Please help, if I can get this working then I can use PHP instead of ASP. I need to use PHP4 for session support. I don't want to use PHPLIB because I will eventually move this code to a Solaris box and I want to use 'pure' PHP4 if at all possible. ------------------------------------------------- Created by Zkey.com - http://www.zkey.com Awarded PCMagazine's Editors' Choice

« previous php.windows (#169) next »