7

I would need to connect to Oracle DB in my PHP codes.

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.

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:

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?

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.

PHPInfo's Configure Command:

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.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
Jemru
  • 2,091
  • 16
  • 39
  • 52

2 Answers2

0

Try to copy

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

from your instantclient-basic-windows.x64-xxx.zip to C:\Windows\SysWOW64. Then restart IIS service and check phpinfo().

Only php_oci8.dll should be enabled.

My Path environment variable contain only PHP path, without instantclient.

It helped me.

0x5a4d
  • 750
  • 1
  • 7
  • 21
0

You would find answers on your questions in the official link: http://www.oracle.com/technetwork/articles/dsl/technote-php-instant-084410.html

Yazid Erman
  • 1,166
  • 1
  • 13
  • 24