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. I opened IIS PHP Manager, then go to PHP Extensions, then I enabled "php_oci8.dll" extension.
我正在使用Windows Server 2012, IIS 8和PHP Manager,以及PHP版本5.5.5.11。打開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. Do I need to reboot?
我只是使用IIS管理器重新啟動了IIS,但是沒有重啟計算機。我需要重新啟動嗎?
Do I also need to download "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.
我還需要下載“instantclient-basic-window .x64- 12.1.0.1.0.1.0.zip”嗎?我試圖將它提取出來,並將目錄放在“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.
非常感謝。
2 个解决方案
#1
0
Try to copy
嘗試復制
orannzsbbxx.dll
orannzsbbxx.dll
oci.dll
oci.dll
oraocieixx.dll
oraocieixx.dll
from your instantclient-basic-windows.x64-xxx.zip to C:\Windows\SysWOW64. Then restart IIS service and check phpinfo().
從你的instantclient-basic-windows.x64-xxx。郵政,C:\Windows\SysWOW64.然后重新啟動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.
它幫助了我。
#2
0
您可以在官方鏈接中找到您的問題的答案:http://www.oracle.com/technetwork/articles/dsl/technote-php- instant084410.html