How to install OCI8 (PHP extension to access Oracle Databases) on a RHEL / Fedora Linux system.

Download from :

EDIT 2013/09/24 :

  • RPM Instant Client Package – SDK: Additional header files and an example makefile for developing Oracle applications with Instant Client
  • RPM Instant Client Package – Basic: All files required to run OCI, OCCI, and JDBC-OCI applications

Install both RPM packages :

rpm -ivh instantclient-basic-linux.XXX.rpm
rpm -ivh instantclient-sdk-linux.XXX.rpm

Install some prerequisite

yum install php-pear
yum install php-devel

Download the OCI8 extension

pear download pecl/oci8
tar xvzf oci8-1.4.7.tgz
cd oci8-1.4.7/

Configure the extension with your Oracle client library path (change the path …/11.2/… with your own version) :

./configure --with-oci8=shared,instantclient,/usr/lib/oracle/11.2/client64/lib/

Compil and install

make install

Configure SELinux : allows httpd to execute programs that require memory addresses that are both executable and writeable

setsebool -P httpd_execmem 1

Add the folowing configuration at the end of php.ini

vi /etc/php.ini

Restart Apache

service httpd restart

That’s all folks.