oracle 使用 XAMPP 调用未定义的函数 oci_connect()
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/41652210/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Stuck Call to undefined function oci_connect() using XAMPP
提问by Maestro Vladimir
i'm want connect PHP to Oracle Database 12c, i'm already try in this video https://www.youtube.com/watch?v=KJme5JMxKeo
我想将 PHP 连接到 Oracle Database 12c,我已经在这个视频中尝试过 https://www.youtube.com/watch?v=KJme5JMxKeo
i'm already install xampp v3.2.2 and using PHP 5.6
install oracle database 12c : http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
unzip and paste Instant Client(Version 12.1.0.2.0) http://www.oracle.com/technetwork/topics/winsoft-085727.htmlto directory C
set path environtment C:\instantclient_12_1;
and already download php_oci8_12c.dll file in here : http://pecl.php.net/package/oci8/2.0.8/windows
and already paste to in C:\xampp\php\ext
when i test script connect : http://pastebin.com/f1isKKar
我已经安装了 xampp v3.2.2 并使用 PHP 5.6
安装 oracle 数据库 12c:http: //www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
解压并粘贴 Instant Client(版本 12.1.0.2.0) http://www.oracle.com/technetwork/topics/winsoft-085727.html到目录 C
设置路径环境C:\instantclient_12_1;
并且已经在这里下载了 php_oci8_12c.dll 文件:http://pecl.php.net/package/oci8/2.0.8/windows
并且已经粘贴到C:\xampp\php\ext
当我测试脚本连接时:http: //pastebin.com/f1isKKar
error message : Call to undefined function oci_connect()
错误消息:调用未定义的函数 oci_connect()
i'm confused why can't connect to ORACLE DATABASE 12c :(
我很困惑为什么无法连接到 ORACLE DATABASE 12c :(
回答by Manyalo
you are very close.
你很亲近。
Add oci.dll, oraociei12.dll, and oraons.dll from C:\instantclient_12_1 to xampp/apache/bin folder. Replace the existing ones.
Restart the Apache
将 C:\instantclient_12_1 中的 oci.dll、oraociei12.dll 和 oraons.dll 添加到 xampp/apache/bin 文件夹中。替换现有的。
重启阿帕奇
N.B: Make sure that your PATH environment variable are set to this folder "C:\instantclient_12_1".
注意:确保您的 PATH 环境变量设置为此文件夹“C:\instantclient_12_1”。
回答by Christopher Jones
Check whether command line PHP works. See if there are any log errors. Make sure you have the right OCI8 DLL. Triple check you have 32bit Oracle Instant Client and that it occurs first in PATH. If you have other Oracle libraries installed then your webserver may be finding them first: fix this.
检查命令行 PHP 是否有效。查看是否有任何日志错误。确保您拥有正确的OCI8 DLL。三重检查您是否拥有 32 位 Oracle Instant Client,并且它首先出现在 PATH 中。如果您安装了其他 Oracle 库,那么您的网络服务器可能会首先找到它们:修复此问题。
回答by mustafa-naeem
i have the exact same problem and fix it in the php.ini file by uncommenting this
我有完全相同的问题,并通过取消注释在 php.ini 文件中修复它
extension_dir = "./"
"remove semicolon"
extension_dir = "./"
“删除分号”