How to connect from php to Oracle DB 12c?

≯℡__Kan透↙ 提交于 2019-12-11 15:46:12

问题


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.

  1. 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)
  2. setup ENVIRONMENT PATH for c:\instantclient_12_2 before any oracle directory. Restart PC
  3. download oci8 dll from http://pecl.php.net/package/oci8/2.0.6/windows
  4. select 5.5 Thread Safe (TS) x64 from above link
  5. unzip and copy all files to c:/xampp/php/ext directory
  6. open php.ini remove (;) for extension=php_oci8.dll, extension=php_oci8_12c.dll and save it
  7. restart apache
  8. look phpinfo and search for oci8 module if found and enabled then ok.
  9. test with php oracle connection script .


来源:https://stackoverflow.com/questions/48673057/how-to-connect-from-php-to-oracle-db-12c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!