【问题标题】:IIS 8 - PHP Manager - Enabling php_oci8.dll for Oracle ConnectionIIS 8 - PHP 管理器 - 为 Oracle 连接启用 php_oci8.dll
【发布时间】:2014-10-16 04:06:33
【问题描述】:

我需要在我的 PHP 代码中连接到 Oracle DB。

我使用的是 Windows Server 2012、带有 PHP 管理器的 IIS 8 和 PHP 版本 5.5.11。 我打开了 IIS PHP Manager,然后转到 PHP Extensions,然后我启用了“php_oci8.dll”扩展。

extension=php_oci8.dll     
;extension=php_oci8_11g.dll

但是,当我尝试连接到 Oracle DB 时,我收到以下 PHP 错误:

PHP Fatal error:  Call to undefined function oci_connect()

我刚刚使用 IIS 管理器重新启动了 IIS,但没有重新启动计算机。需要重启吗?

我还需要下载“instantclient-basic-windows.x64-12.1.0.1.0.zip”吗? 我尝试将其解压缩并将目录放入“Path”环境变量中,但仍然无法正常工作。

PHPInfo 的配置命令:

cscript /nologo configure.js "--enable-snapshot-build" "--enable-debug-pack" 
"--disable-zts" "--disable-isapi" "--disable-nsapi" "--without-mssql" 
"--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=C:\php-sdk\oracle\x86\instantclient10\sdk,shared" 
"--with-oci8=C:\php-sdk\oracle\x86\instantclient10\sdk,shared" 
"--with-oci8-11g=C:\php-sdk\oracle\x86\instantclient11\sdk,shared" 
"--with-enchant=shared" "--enable-object-out-dir=../obj/" 
"--enable-com-dotnet=shared" "--with-mcrypt=static" 
"--disable-static-analyze" "--with-pgo"

非常感谢您。

【问题讨论】:

    标签: php oracle iis-8 oracle-call-interface php-manager


    【解决方案1】:

    您可以在官方链接中找到问题的答案: http://www.oracle.com/technetwork/articles/dsl/technote-php-instant-084410.html

    【讨论】:

      【解决方案2】:

      尝试复制

      • orannzsbbxx.dll
      • oci.dll
      • oraocieixx.dll

      从您的 instantclient-basic-windows.x64-xxx.zipC:\Windows\SysWOW64。然后重启IIS服务并检查phpinfo()

      只应启用 php_oci8.dll

      我的Path环境变量只包含PHP路径,没有instantclient。

      它帮助了我。

      【讨论】:

        猜你喜欢
        • 2020-05-13
        • 2014-01-16
        • 2011-04-04
        • 2012-09-30
        • 1970-01-01
        • 1970-01-01
        • 2015-06-15
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多