[英]Fatal error: Call to undefined function oci_connect()
I have the next lines uncommented (in my php.ini): 我的下一行没有注释(在我的php.ini中):
extension=php_oracle.dll
extension=php_oci8.dll
And I downloaded this file instantclient-basiclite-nt-11.2.0.2.0.zip
and unzipped and put that on drive D... 然后我下载了该文件instantclient-basiclite-nt-11.2.0.2.0.zip
并将其解压缩并放在驱动器D上。
I am using Windows XP 我正在使用Windows XP
I set environment variable like this: 我像这样设置环境变量:
LD_LIBRARY_PATH C:\instantclient_11_2:$LD_LIBRARY_PATH
ORACLE_HOME C:\instantclient_11_2
But when I execute oci_connect()
function, I see this error : 但是当我执行oci_connect()
函数时,我看到此错误:
Fatal error: Call to undefined function oci_connect() in ... 致命错误:在...中调用未定义的函数oci_connect()
and i found this warnings on erroeLog file: 我在erroeLog文件上发现了以下警告:
[29-Dec-2011 00:36:39] PHP Warning: PHP Startup: Unable to load dynamic library 'c:\\php\\ext\\php_oci8.dll' - The specified module could not be found. [29-Dec-2011 00:36:39] PHP警告:PHP启动:无法加载动态库'c:\\ php \\ ext \\ php_oci8.dll'-找不到指定的模块。 in Unknown on line 0 在第0行的Unknown中
[29-Dec-2011 00:36:39] PHP Warning: PHP Startup: Unable to load dynamic library 'c:\\php\\ext\\php_oracle.dll' - The specified module could not be found. [2011年12月29日00:36:39] PHP警告:PHP启动:无法加载动态库'c:\\ php \\ ext \\ php_oracle.dll'-找不到指定的模块。
Things to check: 检查事项:
You don't need to set LD_LIBRARY_PATH
nor ORACLE_HOME
. 您无需设置LD_LIBRARY_PATH
或ORACLE_HOME
。 However, you need to add D:\\instantclient_11_2
to the PATH
environmental variable and restart the computer so changes apply. 但是,您需要将D:\\instantclient_11_2
添加到PATH
环境变量中,然后重新启动计算机,以便应用更改。
Before configuring PHP, check that your Oracle client libraries actually work (for instance, try to connect with SQL Developer). 在配置PHP之前,请检查您的Oracle客户端库是否真正起作用(例如,尝试与SQL Developer连接)。
Comment out the extension=php_oracle.dll
. 注释掉extension=php_oracle.dll
。 It belongs to the old and deprecated Oracle extension. 它属于旧的且已弃用的Oracle扩展。
Double check that the php_oci8.dll
file is really at c:\\php\\ext\\php_oci8.dll
? 仔细检查php_oci8.dll
文件是否确实位于c:\\php\\ext\\php_oci8.dll
?
将php_oci8.dll
文件放入php/ext
目录后,是否重新启动了Apache?
Just add this line to the php.in file that point to the location of extensions, should know where they are located, but normally in php folder. 只需将此行添加到php.in文件中即可指向扩展的位置,应该知道它们的位置,但通常在php文件夹中。
extension_dir = C:\\xampp\\php\\ext ;
this is for me using xampp, be wise. 这是我使用xampp的明智选择。
It worked for me. 它为我工作。 The problem is with accessing the extensions and has nothing to do with oracle libraries. 问题在于访问扩展,与oracle库无关。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.