Php connects to Oracle and prompts CalltoundefinedfunctionOra_Logon () to write a short piece of code according to the Data & lt ;? If & nbsp; ($ connOra_Logon (& quot; hr @ TNSNAME & quot;, & quot; hr & quot;) {echo & nbsp; & quot; connect SUCCES php to Oracle, message: Call to undefined function Ora_Logon ()
A short piece of code written by data
If ($ conn = Ora_Logon ("hr @ TNSNAME", "hr "))
{
Echo "SUCCESS! Connected to database \ n ";
}
Else
{
Echo "Failed:-(cocould not connect to database \ n ";}
Ora_Logoff ($ conn );
Phpinfo ();
?>
The prompt "Ora_Logon function" is defined. why?
In php. ini, I have removed the semicolon of extension = php_oci8.dll.
In addition, php_oci8.dll is included in windows/system32.
------ Solution --------------------
In this case, you can install the Oracle extension ......
And ora_logon belongs to the CXIII. Oracle function (obsolete)
You must use the CVII. Oracle function.
Http://cn.php.net/manual/zh/ref.oci8.php
------ Solution --------------------
Did you config your php with Oracle while installing it? Please check below
./Configure -- prefix =/appbin/php -- with-apxs2 =/appbin/apache/bin/apxs -- with-oci8 = $ ORACLE_HOME
$ ORACLE_HOME is path which your Oracle clinet/server located,
Then uses oci_connect () or oci_newconnect (), Please check php doc for detail