>  기사  >  백엔드 개발  >  php连接Oracle,提示Call to undefined function Ora_Logon(),该如何解决

php连接Oracle,提示Call to undefined function Ora_Logon(),该如何解决

WBOY
WBOY원래의
2016-06-13 13:53:491109검색

php连接Oracle,提示Call to undefined function Ora_Logon()
按照资料写的一小段代码



if   ($conn=Ora_Logon( "hr@TNSNAME ", "hr "))
{
echo   "SUCCESS   !   Connected   to   database\n ";
}
else
{
echo   "Failed   :-(   Could   not   connect   to   database\n ";}
Ora_Logoff($conn);
phpinfo();
?>  

提示   Ora_Logon函数为定义,为什么?

我在php.ini里面已经把extension=php_oci8.dll的分号去掉
并且把php_oci8.dll考入windows/system32里面了。

------解决方案--------------------
不是你这样就可以安装好Oracle的扩展的……


而且ora_logon属于CXIII. Oracle 函数(已废弃)

你一要用 CVII. Oracle 函数

http://cn.php.net/manual/zh/ref.oci8.php
------解决方案--------------------
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 用oci_connect() or 用oci_newconnect(),Please check php doc for detail

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.