note 37179 deleted from function.ora-logon by danbrown
| From: | danbrown@php.net | Date: | Fri, 26 Sep 2008 16:43:54 +0000 |
| Subject: | note 37179 deleted from function.ora-logon by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-144811@lists.php.net to get a copy of this message | ||
Note Submitter: php developer
----
I also goy the ORA-1245 error using ora_logon, but setting the ORACLE_HOME var so it showed up in
both the Apache Environment and Environment sections in phpinfo didn't help the situation. The
full error was "Warning: Oracle: Connection Failed: ORA-12545: Connect failed because target
host or object does not exist in /path/to/script on line xx." Turns out I had the oracle client
installed (which is required) and I had the environment correct (which is required), but I
didn't have a local tnsnames.ora file setup, so the connection couldn't find the correct
binaries to connect to oracle. Creating the tnsnames.ora file on the local server (db server is
remote) and using the proper syntax of "ora_logon("user@tnsentry",
"password");" worked for me. Note: ORACLE_HOME and ORACLE_SID were set in the script
using putenv.