PHP 5.3.1 未在 Windows 上加载 php_oci8.dll
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12820429/
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
PHP 5.3.1 not loading php_oci8.dll on Windows
提问by thclpr
I'm trying to load the oracle extension on php but im having the error:
我正在尝试在 php 上加载 oracle 扩展,但出现错误:
Warning: PHP Startup: Unable to load dynamic library 'D:\Program Files\xampp\php\ext\php_oci8.dll' - The specified procedure could not be found. in Unknownon line 0
警告:PHP 启动:无法加载动态库 'D:\Program Files\xampp\php\ext\php_oci8.dll' - 找不到指定的程序。在未知的第0行
I have done so far:
到目前为止我已经做了:
- Included on windows path the the fullpath of oracle instant client
- on php.ini, the
extension_diris pointing to the right place - on php.ini
extension=php_oci8.dllis ok - restarted the apache, and nothing works.
- 在windows路径中包含oracle即时客户端的完整路径
- 在 php.ini 上,
extension_dir指向正确的位置 - 在 php.ini
extension=php_oci8.dll上没问题 - 重新启动了apache,没有任何效果。
回答by thclpr
Problem solved by copying the files orannzsbb11.dll , oci.dll and oraociei11.dll to c:\windows\system32
通过将文件 orannzsbb11.dll 、 oci.dll 和 oraociei11.dll 复制到 c:\windows\system32 解决了问题
回答by Hidaya Sekkal
You will need to download Oracle Instant client from this hyperlink http://www.oracle.com/technetwork/topics/winsoft-085727.html. Add the path to the instant client on the user environment vriables and the system variables.
您需要从此超链接http://www.oracle.com/technetwork/topics/winsoft-085727.html下载 Oracle Instant 客户端 。在用户环境变量和系统变量上添加即时客户端的路径。
回答by Dwayne Driskill
I solved this problem by adding "C:\Program Files (x86)\PHP\v5.3\ext" to my Windows PATH environment variable. You'll just have to remember to change the path if you upgrade PHP. I think this is better than copying dlls which could lead to issues down the road if you end up with multiple dlls with different versions on the same machine.
我通过将“C:\Program Files (x86)\PHP\v5.3\ext”添加到我的 Windows PATH 环境变量中解决了这个问题。如果您升级 PHP,您只需要记住更改路径。我认为这比复制 dll 更好,如果您最终在同一台机器上使用多个不同版本的 dll,这可能会导致问题。
回答by ivarrian
For me, this was caused by not having the Visual C++ Redistributable for Visual Studio 2008 SP1 (for VC9) installed. I had to get the x64 package as I'm running Windows 7 64bit. Hopefully this helps someone with the same problem. After installing it, PHP no longer reported those errors.
对我来说,这是由于没有安装 Visual Studio 2008 SP1(用于 VC9)的 Visual C++ Redistributable 造成的。我必须获得 x64 包,因为我运行的是 Windows 7 64 位。希望这可以帮助有同样问题的人。安装后,PHP 不再报告这些错误。
回答by Swadesh
I found the main cause behind this issue is the oci8 driver version of oracle. Finally i was able to connect to oracle and the steps i described here at http://angularcode.com/connecting-php-to-oracle-database-10g/
我发现这个问题背后的主要原因是 oracle 的 oci8 驱动程序版本。最后,我能够连接到 oracle 以及我在http://angularcode.com/connecting-php-to-oracle-database-10g/ 上描述的步骤
回答by alexkb
Possibly quite obvious to some, but wasn't initially for me: if you're still seeing this The specified procedure could not be found. in Unknown on line 0error, even after installing the instant client, SDK, and so on - make sure you put the Oracle instant client path in your system"PATH" variable, not the uservariable, as user obviously doesn't get used when Apache runs. You can verify that the instant client path is set properly by reviewing the PATH value shown in your phpinfo() output.
对某些人来说可能很明显,但最初对我来说不是:如果您仍然看到此The specified procedure could not be found. in Unknown on line 0错误,即使在安装了即时客户端、SDK 等之后 - 确保将 Oracle 即时客户端路径放在您的系统“PATH”中" 变量,而不是用户变量,因为在 Apache 运行时用户显然不会被使用。您可以通过查看 phpinfo() 输出中显示的 PATH 值来验证即时客户端路径是否设置正确。

