Debian Jessie compiling PHP with OCI8 & PDO OCI

First we need to grab instant client from oracle..
Basic and Devel RPM packages is enough.

Before we install PHP we need to install prerequisites.

sudo apt-get install gcc libbz2-dev libpng12-dev libc-client2007e-dev libmcrypt-dev libxml2-dev libcurl4-openssl-dev libxslt1-dev libaio1 apache2-dev alien

Turn rpm packages to debian packages with alien.

sudo alien -d oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
sudo alien -d oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm

Install instant client packages we freshly converted.

sudo dpkg -i oracle-instantclient12.1-basic_12.1.0.2.0-2_amd64.deb
sudo dpkg -i oracle-instantclient12.1-devel_12.1.0.2.0-2_amd64.deb

Download latest php source from php.net; for example;

wget http://php.net/distributions/php-5.6.19.tar.bz2

tar -jxvf php-5.6.19.tar.bz2

cd php-5.6.19

export paths to system;

export PATH=/usr/lib/oracle/12.1/client64/bin:$PATH
export ORACLE_HOME=/usr/lib/oracle/12.1/client64/
export C_INCLUDE_PATH=/usr/include/oracle/12.1/client64/

now we configure to generate make files;

./configure --with-pdo-oci --with-oci8 --with-pdo-oci --with-apxs2=/usr/bin/apxs2 --with-kerberos --with-mysql --with-pdo-mysql --with-bz2 --with-curl --with-gd --with-imap --with-imap-ssl --enable-mbstring --with-mcrypt --with-openssl --enable-zip --with-zlib --disable-phar

(if you need phar, delete last option).

make & install

make
sudo make install

Leave a Reply

Your email address will not be published. Required fields are marked *

three × 3 =