Homebrew PHP 5.6 With Oracle PDO_OCI 8

I follow this instruction but with some small modifications:

I use oracle instant client version on El Capitan:

sudo mkdir /usr/local/instantclient
sudo mkdir /usr/local/instantclient/

All downloaded zip files extracted to /usr/local/instantclient/

Then the symlinks:

sudo ln -s /usr/local/instantclient/*.h /usr/local/include/
sudo ln -s /usr/local/instantclient/ /usr/local/bin/
sudo ln -s /usr/local/instantclient/*.dylib /usr/local/lib/
sudo ln -s /usr/local/instantclient/*.dylib.12.1 /usr/local/lib/
sudo ln -s /usr/local/lib/libclntsh.dylib.12.1 /usr/local/lib/libclntsh.dylib

Make sure pecl is installed/enabled, if not then:

sudo php /usr/lib/php/install-pear-nozlib.phar -d /usr/local/lib/php -b /usr/local/bin

Build the php oci8 extension:

sudo pecl install -f oci8-2.0.11

If you are prompted to input the ORACLE_HOME path, input with instantclient,/usr/local/lib.

Please provide the path to the ORACLE_HOME directory. Use 'instantclient,/path/to/instant/client/lib' if you're compiling with Oracle Instant Client [autodetect] :

Add the extensions to be loaded. Create new file:

vim /usr/local/etc/php/5.6/conf.d/ext-oci8.ini

With this content:


Restart Apache

sudo apachectl restart

Test it