Page 1 of 1
Oracle Login problem
Posted: Wed Sep 29, 2004 2:54 am
by Cesar
I like to connect to the oracle server, but i find this
Fatal error: Call to undefined function: ora_logon() in C:\Inetpub\wwwroot\test\test.php on line 2
Code: Select all
<?php
if ($c=ora_logon("SCOTT", "tiger")) {
echo "Successfully connected to Oracle.\n";
ora_logoff($c);
} else {
$err = ora_error($c);
echo "Oracle Connect Error " . $err;}
?>
Why? Please explain.
Posted: Wed Sep 29, 2004 2:57 am
by patrikG
user notes in PHP Manual (ora_logon()) wrote:Devon (12-Apr-2001 12:38)
In addition to above comments - I had a ORA-12545 error using ora_logon that I eventually found was simply a var/path problem - when you start up "apachectl start" make sure apache can find oracle!
keithv at bzlninc dot com (15-Mar-2000 12:10)
In order to get this to work properly I needed to have the ORACLE_HOME variable set before starting the Apache web server. I put it in the /etc/profile file, but you can do it anyway you choose.
Posted: Wed Sep 29, 2004 3:46 am
by Cesar
i have php4 and IIS, not Apache.
Posted: Wed Sep 29, 2004 4:58 am
by redmonkey
The 'call to undefined function' error generally points to PHP not being compiled with that particular module (in this case oracle) or (where applicable) the extension has not been specified to be loaded in php.ini
As previously mentioned, you do need the ORACLE_HOME environment variable set correctly.
Posted: Wed Sep 29, 2004 5:38 am
by Cesar
Previus error i corrected, but i have a new error:
Warning: ocilogon() [function.ocilogon]: _oci_open_server: ORA-12640: Authentication adapter initialization failed in
Posted: Wed Sep 29, 2004 7:54 am
by redmonkey
Personally I have very little knowledge of Oracle, however, quizzing a man who does suggests that you should locate and open the file... ORACLE_HOME\network\admin\sqlnet.ora
Then find the line..... sqlnet.authentication_services=(NTS)
And either remove it or replace it with.... sqlnet.authentication_services=(NONE)
I have no idea if this will work or indeed if there are any knock on implications but may be worth a try.
Posted: Wed Sep 29, 2004 9:52 am
by feyd
Cesar, your choice in topic titles needs work..
I've switched it to something more useful.
Posted: Wed Sep 29, 2004 11:03 am
by hedge
I have had issues with php being able to find the tnsnames.ora, to get around this I provide the entire section from the tnsnames as the connect string.
Posted: Wed Sep 29, 2004 11:33 pm
by Cesar
redmonkey thank you for your suggestion, but after changes sqlnet.authentication_services=(NTS) to sqlnet.authentication_services=(NONE) problem not corrected and i cant login to my database on dbastudio.
feyd why you mean "needs work".
Posted: Wed Sep 29, 2004 11:36 pm
by feyd
topic titles should be descriptive. "php error" or whatever it was isn't helpful to us.
Oracle connecting
Posted: Tue Nov 02, 2004 6:29 pm
by Ashabbir
Hye I'm quite new to the oracle connecting thing. I'm using Oracle 9i and want to connect to that through PHP. Does anyone know the syntax?
Need help, lol
Any help will appreciated