简体   繁体   English

IIS 8 - PHP 管理器 - 为 Oracle 连接启用 php_oci8.dll

[英]IIS 8 - PHP Manager - Enabling php_oci8.dll for Oracle Connection

I would need to connect to Oracle DB in my PHP codes.我需要在我的 PHP 代码中连接到 Oracle DB。

I'm using Windows Server 2012, IIS 8 with PHP Manager, and PHP version 5.5.11.我使用的是 Windows Server 2012、带有 PHP 管理器的 IIS 8 和 PHP 版本 5.5.11。 I opened IIS PHP Manager, then go to PHP Extensions, then I enabled "php_oci8.dll" extension.我打开 IIS PHP 管理器,然后转到 PHP 扩展,然后启用“php_oci8.dll”扩展。

extension=php_oci8.dll     
;extension=php_oci8_11g.dll

However when I tried to connect to Oracle DB I'm getting the following PHP error:但是,当我尝试连接到 Oracle DB 时,出现以下 PHP 错误:

PHP Fatal error:  Call to undefined function oci_connect()

I just restarted the IIS using the IIS Manager, but didn't done computer reboot.我只是使用 IIS 管理器重新启动了 IIS,但没有重新启动计算机。 Do I need to reboot?我需要重新启动吗?

Do I also need to download "instantclient-basic-windows.x64-12.1.0.1.0.zip"?我还需要下载“instantclient-basic-windows.x64-12.1.0.1.0.zip”吗? I tried to extract it and put the directory in "Path" environment variable, but still don't work.我试图提取它并将目录放在“Path”环境变量中,但仍然不起作用。

PHPInfo's Configure Command: 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"

Thank you very much in advance.非常感谢您提前。

Try to copy尝试复制

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

from your instantclient-basic-windows.x64-xxx.zip to C:\\Windows\\SysWOW64 .从您的Instantclient-basic-windows.x64-xxx.zipC:\\Windows\\SysWOW64 Then restart IIS service and check phpinfo() .然后重新启动 IIS 服务并检查phpinfo()

Only php_oci8.dll should be enabled.只应启用php_oci8.dll

My Path environment variable contain only PHP path, without instantclient.我的Path环境变量只包含 PHP 路径,没有 Instantclient。

It helped me.它帮助了我。

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

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

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