note 16938 added to ref.oracle
| From: | evergr_ at hotmail dot com | Date: | Mon, 19 Nov 2001 18:35:59 +0000 |
| Subject: | note 16938 added to ref.oracle | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-21021@lists.php.net to get a copy of this message | ||
For a couple of days now I've been trying to establish an Oracle connection with no luck. My
environment is:<br>
Win NT
Apache 1.3.20
PHP 4.0.6 CGI
Oracle 7.3
I get 2 types of errors:
1) ORA-12154: TNS:could not resolve service name<br>
2) ORA-03121: no interface driver connected<br>
I get the first error when my connect statement looks like this:<br>
Ora_Logon("user@db.world","passwd");
<br>
The second error comes up when I use the following connect statement:<br>
Ora_Logon("user","passwd");<br>
I have verified my tnsnames.ora and it looks fine I got rid of the CR, as I saw in one of the posts
that CR might be messing this up.
My phpinfo() shows Oracle-Support as enabled. I created a direcotry called extensions in the root
php directory and dropped php_oracle.dll in it, then I uncommented: extension=php_oracle.dll in my
php.ini file and verified: extension_dir = "c:\php\extensions"
<br>
Any suggestions will be strongly appreciated. Thank you.
Here is my code:<br>
=====================================
<br>
<
putenv("ORACLE_SID=db.world");
putenv("ORACLE_HOME=C:\ORANT");
putenv("TNS_ADMIN=C:\ORANT\NETWORK\ADMIN");
if(!($connection=Ora_Logon("user@db.world","passwd")))
{
echo "Couldn't logon to database.";
exit();
}
else
echo "Connected to database";
OCILogoff($connection);
>
--
http://www.php.net/manual/en/ref.oracle.php
http://master.php.net/manage/user-notes.php?action=edit+16938
http://master.php.net/manage/user-notes.php?action=delete+16938
http://master.php.net/manage/user-notes.php?action=reject+16938