How to install the OCI8 PHP extension on Mac OS X 10.8 Mountain Lion

Alastair picture Alastair · Oct 25, 2012 · Viewed 9.4k times · Source

I need to use the OCI8 module for PHP on Mountain Lion which will use the oracle instant client, which is currently only supported as 32 bit.

I have installed the 32bit version of the oracle instant client and tested it with sqlplus and all seems well.

Now however I need to get the PHP extension OCI8 working, which has led me to build a 32 bit PHP module for apache with homebrew. Again this seems to be working but as I understand it this will now require a 32 bit build of Apache, the built-in version seems to be 64 bit only. I can't work out how to build Apache as 32 bit and I'm not even certain this is required so am at somewhat of a loss. Any help much appreciated Alastair

EDIT:

For now I have abandoned a native install in favour of virtualised development using Vagrant and Ubuntu: https://github.com/afhole/vagrant-lamp

Answer

Brice Miramont picture Brice Miramont · Mar 13, 2013

Go there : http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html

Use the Version 11.2.0.3.0 (64-bit) of the files.

EDIT: In the instructions provided below, change the line :

sudo ln -s libclntsh.dylib.10.1 libclntsh.dylib

to

sudo ln -s libclntsh.dylib.11.1 libclntsh.dylib

Installation instructions are here : http://www.enavigo.com/2012/01/04/enabling-oracle-oci8-php-extension-on-os-x-snow-leopard/

It works on my Macbook Air under 10.8.2