致命错误:调用未定义的函数 oci_connect()
我未注释掉下一行(在我的 php.ini 中):
extension=php_oracle.dll
extension=php_oci8.dll
我下载了此文件 instantclient-basiclite-nt-11.2.0.2.0.zip
并解压缩并将其放在驱动器 D 上...
我使用的是 Windows XP,
我设置环境变量如下:
LD_LIBRARY_PATH C:\instantclient_11_2:$LD_LIBRARY_PATH
ORACLE_HOME C:\instantclient_11_2
但是当我执行 oci_connect() 函数时,我看到此错误:
致命错误:调用...中未定义的函数 oci_connect()
,我在 erroeLog 文件中发现了此警告:
[2011 年 12 月 29 日 00:36:39] PHP 警告:PHP 启动:无法加载动态库 'c:\php\ext\php_oci8.dll' - 找不到指定的模块。 在第 0 行未知
[2011 年 12 月 29 日 00:36:39] PHP 警告:PHP 启动:无法加载动态库 'c:\php\ext\php_oracle.dll' - 找不到指定的模块。
I have the next lines uncommented (in my 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...
I am using 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 :
Fatal error: Call to undefined function oci_connect() in ...
and i found this warnings on erroeLog file:
[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.
in Unknown on line 0[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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
要检查的事项:
您不需要设置
LD_LIBRARY_PATH
也不需要设置ORACLE_HOME
。但是,您需要将D:\instantclient_11_2
添加到PATH
环境变量中,并重新启动计算机以使更改生效。在配置 PHP 之前,检查您的 Oracle 客户端库是否实际工作(例如,尝试连接 SQL Developer)。
在配置 PHP
注释掉
extension=php_oracle.dll
。它属于旧的且已弃用的 Oracle 扩展。仔细检查
php_oci8.dll
文件是否确实位于c:\php\ext\php_oci8.dll
?Things to check:
You don't need to set
LD_LIBRARY_PATH
norORACLE_HOME
. However, you need to addD:\instantclient_11_2
to thePATH
environmental variable and restart the computer so changes apply.Before configuring PHP, check that your Oracle client libraries actually work (for instance, try to connect with SQL Developer).
Comment out the
extension=php_oracle.dll
. It belongs to the old and deprecated Oracle extension.Double check that the
php_oci8.dll
file is really atc:\php\ext\php_oci8.dll
?将 php_oci8.dll 文件放入 php/ext 目录后是否重新启动了 apache?
Did you restart apache after putting the
php_oci8.dll
file in yourphp/ext
directory?只需将此行添加到指向扩展位置的 php.in 文件中,应该知道它们所在的位置,但通常在 php 文件夹中。
extension_dir = C:\xampp\php\ext ;
这是给我使用 xampp 的,明智点。这对我有用。问题在于访问扩展,与 oracle 库无关。
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.
extension_dir = C:\xampp\php\ext ;
this is for me using xampp, be wise.It worked for me. The problem is with accessing the extensions and has nothing to do with oracle libraries.