Setting up an Oracle / PHP connection

Connecting to Oracle from PHP:

Download the oracle instant client basic and devel files:

oracle-instantclient-basic- and

from the oracle website and install them:

# rpm -i oracle-instantclient-basic- 
# rpm -i oracle-instantclient-devel-

Download and unpack the latest version of PHP source from

run this to configure php (apache2):

./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-oci8=instantclient,/usr/lib/oracle/ 
--enable-soap --with-zlib --enable-mbstring=all --with-iconv --enable-sigchild

if you get this error: checking Oracle Instant Client SDK header directory… configure: error: Oracle Instant Client SDK header files not found it means your oracle devel package didnt install correctly.

then run

# make
# make install

If you are having issues using oci_pconnect (causing apache segmentation faults) then you will need to use –with-oci8=shared,instantclient,/usr/lib/oracle/ and install the 1.3.0 version of the OCI client from

Leave a Reply

Your email address will not be published.