0

OCI Connect

Based upon the above, it states that one should avoid OCI connection on Windows. Have someone configured it on Windows? I have gone through all other threads, this and this, using Windows Server 2012 with PHP 5.6 and Oracle 11g but still having issue:

Call to undefined function oci_connect()

I have set the path: c:/instantclient_12_1

Under php.ini, one can see:

;extension=php_oci8.dll
extension=php_oci8_11g.dll

while under /php/ext

there is only file: php_oci8_12c.dll

This is the output of phpinfo() to show configure command:

cscript /nologo configure.js "--enable-snapshot-build" "--disable-isapi" "--enable-debug-pack" "--without-mssql" "--without-pdo-mssql" "--without- pi3web" "--with-pdo-oci=c:\php-sdk\oracle\x86\instantclient_12_1\sdk,shared" "--with-oci8-12c=c:\php-sdk\oracle\x86\instantclient_12_1\sdk,shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--without-analyzer" "--with-pgo"

What is the reason of an error undefined function oci_connect()?

Community
  • 1
  • 1
Muhammad Muazzam
  • 2,810
  • 6
  • 33
  • 62
  • If you don't get an answer here, you might want to ask this on Serverfault.com (SO's sister site) which is more suited to this kind of question. – Simba Nov 24 '15 at 15:23
  • PHP/OCI is no problem on Windows; I have it running on several production servers. You've already linked to [my previous answer](http://stackoverflow.com/a/29515269/3775731), which is about as comprehensive as you'll find on this topic. Have you checked the `php_errors.log` file for startup errors? – timclutton Nov 25 '15 at 09:44
  • And check the output of `where oci*` at the command line to confirm the system path contains the correct reference to your oci client files. – timclutton Nov 25 '15 at 09:46
  • I have linked your answer in my post – Muhammad Muazzam Nov 25 '15 at 09:49
  • extension=php_oci8_12c.dll is not in php.ini file. If copy it then it shows error: program cant start because php5.dll is missing – Muhammad Muazzam Nov 25 '15 at 13:30
  • I have also followed this http://stackoverflow.com/questions/27566822/xampp-missing-php-eaccelerator-ts-dll but no success. – Muhammad Muazzam Nov 25 '15 at 13:40
  • 2
    `php5.dll is missing` most likely means that you are trying to use a non-thread safe file with a thread safe build of PHP. Try downloading the correct file from [PECL](https://pecl.php.net/package/oci8/2.0.8/windows). – timclutton Nov 25 '15 at 15:13
  • The issue get resolved after placing the file php_oci8_11g.dll in /php/ext folder – Muhammad Muazzam Nov 26 '15 at 07:42
  • Thanks to @timclutton – Muhammad Muazzam Nov 26 '15 at 07:51

1 Answers1

0

Try using following:

extension=php_oci8_12c.dll

in your php.ini, in my case (Windows Server 2008, PHP 5.6) that helped.

Muhammad Muazzam
  • 2,810
  • 6
  • 33
  • 62
Theo
  • 1