Php connects to Oracle and prompts CalltoundefinedfunctionOra_Logon (). how can this problem be solved?

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.