简体   繁体   中英

Enabling PHP oci8_11g extension: Call to undefined function oci_connect()

I'm trying to connect to an oracle database remotely using PHP. I'm working on a Windows 7 machine that's running IIS as its webserver.

I have downloaded/extracted the files of Instant Client 11.2.0.3.0, added the path to the client libraries in %PATH% environmental variables and uncommented the extension=php_oci_11g.dll file in my php.ini file. When I run a oci_connect script it dies on the first line and the PHP error log says:

Fatal error: Call to undefined function oci_connect()

I checked my phpinfo() to see if OCI8 Support was enabled but could only find it in the configure command section see below: 在此处输入图片说明 So I've concluded that Oracle support hasn't been enabled in PHP. I've tried following multiple troubleshooting articles but haven't been able to enable support.

Question: Why does the Configure Command section specify the wrong path to the oci8-11g extension? It's actually located on C:/Program files/PHP/v5.3/ext

Thanks in advance.

UPDATE: If I try to run php -m in CLI I get this error message:

在此处输入图片说明

as well as an error message in the php error log:

PHP Startup: unable to load dynamic library 'C:\\Program files\\PHP\\v5.3\\ext\\php_oci8_11g.dll' – the specified procedure could not be found

Then I did php -v and it gave me this error message: 在此处输入图片说明

What I did was switch from IIS to WAMP and I instantly was able to enable support to the OCI8_11g extension for PHP. I don't know why IIS wasn't allowing me to enable support.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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