Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
install Oracle PHP Extension (oracle OCI8) - instantclient for Mac OS 10.8 - homebrew environnement


This procedure is tested on Mac OS X 10.8 with Developpers tools installed (xCode).

PHP 5.4 installed with Homebrew.

Update: I wrote a blog post about this.


Download the following files from Oracle website (yes, you need to create an account and accept terms):

Create and unzip all theses files into a the directory /usr/local/instantclient/ This directory will looks like:

├── adrci
├── genezi
├── glogin.sql
├── libclntsh.dylib.11.1
├── libnnz11.dylib
├── libocci.dylib.11.1
├── libociei.dylib
├── libocijdbc11.dylib
├── libsqlplus.dylib
├── libsqlplusic.dylib
├── ojdbc5.jar
├── ojdbc6.jar
├── sdk
│   ├── SDK_README
│   ├── demo
│   ├── include
│   ├── ott
│   └──
├── sqlplus
├── uidrvci
└── xstreams.jar

Create symlinks

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

Test with sqlplus instantclient

I recommand to install Oracle Server with a VirtualBox VM preinstalled.

   /usr/local/bin/sqlplus oracle/oracle@

Install extension with pecl

   pecl install oci8

If the script prompt you to provide the path to ORACLE_HOME directory, respond with:


And your are done, normally pecl will automatically load the extension in your php.ini. If not, add the following line to your php.ini:

Restart your HTTP Server and test.

Enjoy (or try to...) !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.