Re: PHP-ORACLE-WINNT-OCI8: _oci_open_server: ORA-12154: TNS: could not resolve
| From: | Steve Farmer | Date: | Mon, 08 Jan 2001 10:57:30 +0000 |
| Subject: | Re: PHP-ORACLE-WINNT-OCI8: _oci_open_server: ORA-12154: TNS: could not resolve | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-5700@lists.php.net to get a copy of this message | ||
Hi Jorge,
At 10:37 AM +0100 8/1/01, Jorge Calvera wrote:
Hi, I have PHP4.0.2 for Windows (www.php4win.de) working in a Windows NT4 (SP6a) and Oracle Client for NT, Release 8.0.5. When I try to connect to a remote Oracle DB, I got this err msg: _oci_open_server: ORA-12154: TNS: Could not resolve service name. This seems to be a TNSNAMES.ORA problem, but tnsping80.exe and sqlplus works fine. I have the following environment variables in my profile environment: ORACLE_BASE=e:\orant ORACLE_HOME=e:\orant TNS_ADMIN=e:\orant\net80\admin\tnsnames.oraThis should be TNS_ADMIN=e:\orant\net80\admin
ORACLE_SID=ORCL I have copied the tnsnames.ora file in : c:\winnt c:\php (PHP installation directory) c:\ e:\orant e:\orant\net80\admin\ (default directory) e:\orant\network\admin\ I execute from a DOS box: C:\php>php oci_sample.PHP Please, help! Thanks in advance, Jorge One more thing, when I try with the line (without db param): OCILogon("scott", "tigger");The password should be "tiger" I think , not "tigger"
Also, confirm that you can connect to the database using Oracle SQL*Plus tool, TNSPING only confirms that your listener is running correctly, not that you cna connect to the database. HTH Steve -- --------------------------------------------------- "I disagree completely with what you are saying, but I will defend to the death your right to say it" - Voltaire Support free speech; visit http://www.efa.org.au/ Heads Together Systems Pty Ltd http://www.hts.com.au Email: hts@hts.com.au Tel: 612 9982 6767 Fax: 612 9981 3081