This content has been marked as final. Show 4 replies
OCILogon('MYUSER', 'MYPASSWD', 'MYDB');This is probably going to sound dumb, and is just a guess, and probably wrong given how you specified your example line of code and indicate a knowledge of Perl, but are you sure you're using single-quotes when specifying your logon information? If you're using double-quotes and there's a special character (like "$") in the password, then PHP might be interpreting the string differently from how you think.
When in doubt, single-quotes in PHP will always give the literal string that your specify.
I only take the guess because I once replied to a guy on this very forum who had made the same mistake... other than that, I'm stumped.
Hope that helps,
I used single quotes, but thanks for the suggestion. I'm sure it is something dumb like that though.
I had this very mistake. In fact, sqlplus in command line was working, and connecting to the db in php command line was working too. The error was happening only when the page was requested throw a browser.
Here is how I solved it :
In /var/log/messages I saw that SElinux was blocking connexions from the http daemon.
I just executed the command
setsebool -P httpd_can_network_connect 1
so that apache would be authorized to connect the db and here it is :)
this works for me:
$db = "(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = landon)(PORT = 1521))
(SERVER = DEDICATED)
(SERVICE_NAME = LMKGDN)
$conn = oci_connect("lmkiii", "xoxoxoxox", $db);
BTW oci_pconnect looks in a cache of old connections for a match...that should save time
I'd get NOTHING done if I left selinux enforcing
I get SELINUX warnings when I am typing in an email under Fedora 9.
Insane! I'd get nowhere!
Glad you are off and running!
Edited by: landonmkelsey on Jan 6, 2009 1:05 PM
Look at this:
Re: ORA-12560: TNS:protocol adapter error