For what it's worth, here is the script I've been using to hook up to 
Oracle (specific for my system removed, of course...):

<?php
putenv("ORACLE_SID=[dbname]");
putenv("ORACLE_HOME=[location of TNS file on server]");
$db = ocilogon("[user]","[password]","[sid]");
echo "Oracle connection status: ";
if($db) {
         echo "<b>Success</B>" ;
} else {
         echo "Failed connecting to oracle.  Exiting program.";
         exit;
}
?>

The key proved to be the two putenv statements at the beginning.



At 05:51 PM 1/17/01 +0100, R Maier wrote:
>Hi,
>I compiled php4 with oci8 support and once the communication was
>working.
>Now I allways get the result ORA-12154: could not resolve servicename.
>I tried tnsping and sqlplus with the listener tracelevel switched to
>ADMIN
>
>With sqlplus I get messages into the tracefile and a connection.
>tnsping can also ping.
>ORACLE_HOME, ORACLE_SID, ORACLE_BASE LD_LIBRARY_PATH, TNS_ADMIN are set.
>
>There must have been a change in the tnsnames.ora or is there something
>that has to be set for php4 ?
>
>thx for vou help.
>
>Rainer
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to