问题
I am using XAMPP v3.2.2 and I am trying to connect from PHP to Oracle database 12c.
I have already commented out the extension php_oci8_12c.dll
in php.ini, restarted Apache, and installed Oracle instantclient_12_2 32bit.
However, I am getting this error:
Fatal error: Uncaught Error: Call to undefined function oci_connect()
回答1:
Follow instructions for XAMPP v3.2.2 and Oracle database 12c config.
- Download instantclient_12_2 and unzip to c:\instantclient_12_2 (make sure your xamp and instantclient both are same architechture x86 or 64-bit)
- setup ENVIRONMENT PATH for c:\instantclient_12_2 before any oracle directory. Restart PC
- download oci8 dll from http://pecl.php.net/package/oci8/2.0.6/windows
- select 5.5 Thread Safe (TS) x64 from above link
- unzip and copy all files to c:/xampp/php/ext directory
- open php.ini remove (;) for extension=php_oci8.dll, extension=php_oci8_12c.dll and save it
- restart apache
- look phpinfo and search for oci8 module if found and enabled then ok.
- test with php oracle connection script .
来源:https://stackoverflow.com/questions/48673057/how-to-connect-from-php-to-oracle-db-12c