Adding Oracle support to PHP

If you want to connect to an Oracle database with PHP you will need the pecl module named oci8

First in order to compile it you will need Oracle Instant Client ( both basic & sdk ) . You can download them from here:

If you don’t have an Oracle account you will need to create one.

At the time of this post the following files are available: , .

Create a directory in /optĀ  mkdir /opt/oracle/instantclient and copy those files there . Then unzip them . You will need to create a symbolic link ln -s

Then you will need to install libaio if you don’t have it already . Don’t forget to add /opt/oracle/instantclient/instantclient_11_2 to /etc/ .

At this point you are ready to install the pecl extension to php.Create a temporary directory ( /tmp/1 ) and cd there.

mkdir /tmp/1

cd /tmp/1

pecl download oci8

tar xf oci8-1.3.5.tar

cd oci8-1.3.5


./configure –with-oci8=shared,instantclient,/opt/oracle/instantclient/instantclient_11_2


make install

edit /etc/php.ini and add

And enjoy oracle extension for php. Note: if you have apache running restart it.