调用未定义的函数 oci_connect() [英] Call to undefined function oci_connect()
问题描述
我收到了这个错误.
Fatal error: Call to undefined function oci_connect()
$conn = oci_connect('localhost', 'username', 'password') or die(could not connect:'.oci_error)
这是代码.
这是我得到的错误.
Fatal error: Call to undefined function oci_connect() in C:xampphtdocsorgorgphpmyphp.php on line 51
我检查了 ext 文件夹中的 PHP DLL 文件.
I checked the PHP DLL files in ext folder.
有人在此问题上提供帮助,提前致谢.
Somebody help on this issue thanks in advance.
推荐答案
我只花了整整三天的时间来解决这个问题.
I just spend THREE WHOLE DAYS fighting against this issue.
我在 Windows 7 中使用我的 ORACLE 连接,没有问题.上周我刚买了一台装有 Windows 8 的新电脑.安装 XAMPP 1.8.2.此服务器上的每个应用程序 PHP/MySQL 都运行良好.当我尝试将我的 php 应用程序连接到 Oracle DB 时出现问题.
I was using my ORACLE connection in Windows 7, and no problem. Last week I Just get a new computer with Windows 8. Install XAMPP 1.8.2. Every app PHP/MySQL on this server works fine. The problem came when I try to connect my php apps to Oracle DB.
调用未定义的函数oci_pconnect()
Call to undefined function oci_pconnect()
当我通过更改启动/停止 Apache 时,PHP 启动"上出现一个奇怪的警告",它会以PHP 警告:PHP 启动:第 0 行未知"进入日志
And when I start/stop Apache with changes, a strange "Warning" on "PHP Startup" that goes to LOG with "PHP Warning: PHP Startup: in Unknown on line 0"
我做了一切(未注释的 php_oci8.dll 和 php_oci8_11g.dll,将 oci.dll 复制到/ext 目录,在/Apache 附近,但没有任何效果.下载 Instant Client 的每个版本,也没有.
I did everything (uncommented php_oci8.dll and php_oci8_11g.dll, copy oci.dll to /ext directory, near /Apache and NOTHING it works. Download every version of Instant Client and NOTHING.
上帝帮助了我.当我下载 ORACLE Instant Client 32 位时,一切正常.phpinfo() 显示 oci8 信息,我的应用程序运行良好.
God came into my help. When I download ORACLE Instant Client 32 bits, everything works fine. phpinfo() displays oci8 info, and my app works fine.
因此,请不要介意您的 WINDOWS 版本是 x64.链接位于 XAMPP 和 ORACLE Instant Client 之间.
So, NEVER MIND THAT YOUR WINDOWS VERSION BE x64. The link are between XAMPP and ORACLE Instant Client.
这篇关于调用未定义的函数 oci_connect()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!