0

I have installed the PHP OCI8 module using a guide from this page.

But when I run my phpfile that has oci_connect it thrown out the page isn't working with error code "HTTP ERROR 500"

What did I do wrong? I tried the command php -m, and I found OCI8 there, and I tried php -v and I got no error at all, but when I tried running my PHP with something like function_exists('oci_connect') or extension_loaded('oci8') both give out false result.

enter image description here

enter image description here

Giacomo1968
  • 53,069
  • 19
  • 162
  • 212
  • 1
    Command line PHP is not the same as the Apache module for PHP. [Look at this answer for more info](https://superuser.com/a/971900/167207). If you don’t have the OCI8 module enabled for the web module, you will get what you are getting. Also, that guide is for PHP 7.1 as incited here: `/etc/php/7.1/mods-available/oci8.ini` Did you add that `extension=oci8.so` to the proper `php.ini` file? That PHP info webpage you have screenshots of should clearly show you which `php.ini` it is using. Just edit that and add the `extension=oci8.so` line and restart Apache to see the module come up. – Giacomo1968 Jan 22 '19 at 03:53
  • I've put extension=oci8.so to every php.ini file(included that inside apache2 and inside oci8.ini inside mods-available library), I've been trying for 1 week and the module just won't load at all – Jeremy Karisma Karis Jan 22 '19 at 06:41
  • `I've put extension=oci8.so to every php.ini file` That sounds like panic and overkill. You only need to put that in the `php.ini` used by the PHP that is loaded. The 500 error in the case of OCI8 usually comes if the directory you decompressed the OCI8 library into (`/opt/oracle/instantclient_12_2`) doesn't exist or the permissions to that directory are off and Apache cannot read that directory. Look in your Apache error logs located in `/var/log/` to see if you can get any clues as to what might be happening. – Giacomo1968 Jan 22 '19 at 11:19

0 Answers0