简体   繁体   English

PHP 无法加载动态库“php_pdo_oci.dll”

[英]PHP unable to load dynamic library “php_pdo_oci.dll”

I'm running Apache 2.4.7 with PHP 5.5.9 on Windows 8. I installed PHPUnit and this warning image "warning" started to pop up.我在 Windows 8 上运行 Apache 2.4.7 和 PHP 5.5.9。我安装了 PHPUnit,这个警告图像“警告”开始弹出。

在此处输入图片说明

Yes I enabled extension loading in php.ini as well as "extension_dir" to correct folder and there is file named "php_pdo_oci.dll" in that folder.是的,我在 php.ini 和“extension_dir”中启用了扩展加载以更正文件夹,并且该文件夹中有名为“php_pdo_oci.dll”的文件。 I tried to use different apache and php releases, but it didn't help.我尝试使用不同的 apache 和 php 版本,但没有帮助。 Any suggestions how to fix this?任何建议如何解决这个问题?

The ..._oci.dll is part of the Oracle C Interface. ..._oci.dll 是 Oracle C 接口的一部分。 Unless you need to use Oracle, I suggest you go to the relevant line inside the php.ini file and uncomment the loading of this extension.除非你需要使用Oracle,否则我建议你去php.ini 文件中的相关行并取消注释加载这个扩展。 However, if you need to use this extension, you'll need to install the free Oracle Client libraries and add them to the path.但是,如果您需要使用此扩展,则需要安装免费的 Oracle 客户端库并将它们添加到路径中。

Oracle has a page where you can download the libraries needed for your setup work as expected and you can see here: Oracle Instant Client Downloads Oracle 有一个页面,您可以在其中按预期下载安装工作所需的库,您可以在此处查看: Oracle Instant Client Downloads

Note: After you choose your operational system (Windows as in your answer) in download section you will see the installation guide in foot notes of the next page.注意:在下载部分选择您的操作系统(Windows 在您的答案中)后,您将在下一页的脚注中看到安装指南。 For others OSs this process will work the same way.对于其他操作系统,此过程将以相同的方式工作。

I currently have PHP version 7.1.9 and encountered this problem and resolved the issue.我目前的 PHP 版本是 7.1.9,遇到了这个问题并解决了这个问题。 Just ensure these lines in your php.ini file are uncommented like so:只需确保 php.ini 文件中的这些行被取消注释,如下所示:

extension=php_fileinfo.dll
extension=php_ftp.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_gmp.dll
extension=php_intl.dll
extension=php_imap.dll
extension=php_interbase.dll
extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll      ; Must be after mbstring as it depends on it
extension=php_mysqli.dll
extension=php_oci8_12c.dll  ; Use with Oracle Database 12c Instant Client
extension=php_openssl.dll
extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
extension=php_pdo_oci.dll
extension=php_pdo_odbc.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
extension=php_pgsql.dll
extension=php_shmop.dll

Please restart your server application (IIS, Apache etc) after any changes to your php.ini file.在对 php.ini 文件进行任何更改后,请重新启动您的服务器应用程序(IIS、Apache 等)。

Please add below line in php.ini file请在 php.ini 文件中添加以下行

extension=pdo.so
extension=php_pdo.dll
extension=php_pdo_oci.dll
extension=php_pdo_oci8.dll

and restart apache server and check.并重新启动apache服务器并检查。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM