Skip to content

Instantly share code, notes, and snippets.

@ilhamarrouf
Last active August 14, 2019 04:00
Show Gist options
  • Save ilhamarrouf/9bfdda594053126c208ff7fe2951bc8e to your computer and use it in GitHub Desktop.
Save ilhamarrouf/9bfdda594053126c208ff7fe2951bc8e to your computer and use it in GitHub Desktop.
Setup OCI8 on Centos7
# Stop Apache and uninstall old versions of OCI8.
$ service httpd stop
$ pecl uninstall oci8
$ sudo yum install php-pear php-devel
$ pear download pecl/oci8
# The next commands depend on the version of oci8 downloaded above.
$ tar xvzf oci8-2.2.0.tgz
$ cd oci8-2.2.0/
$ phpize
$ export PHP_DTRACE=yes
# make sure of the instantclient path below... mine was version 18.3 so it was located in this folder... Also make note some tutorials ask for the ORACLE_HOME folder which theoretically is /usr/lib/oracle/18.3/client64 but if its instantclient then put the lib folder underneath it (worked for me at least:)
$ ./configure --with-oci8=instantclient,/usr/lib/oracle/12.2/client64/lib/
$ make
$ make install
# NOW an .so file built in: /usr/lib64/php/modules/oci8.so
# THIS STEP NOT NEEDED if SELinux disabled on your server/box, but if SELinux is enabled run: setsebool -P httpd_execmem 1
# NOW add: extension=oci8.so at the bottom of your php.ini file (probably in /etc/php.ini)
# Add extension_dir=/usr/lib64/php/modules/
$ sudo service httpd restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment