Re: OCI ORA-12154 error
| From: | Richard S. Crawford | Date: | Wed, 17 Jan 2001 17:54:49 +0000 |
| Subject: | Re: OCI ORA-12154 error | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-5925@lists.php.net to get a copy of this message | ||
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: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net