Compile MongoDB PHP Driver in Mac OSX

If you want to compile mongodb php driver in Mac OSX , first you need to install XCode first.

1. Open the Xcode > Preferences > Downloads > Install Command Line Tools 2. Create the under your home folder. Add following code in

3. Open the terminal and

sudo sh ~/

it will install m4 , autoconf, automake and libtool.

4. Download the mongodb php driver from github .

5. Unzip the file after downloading.

6. Go to downloaded folder from terminal.

cd ~/Downloads/mongo-php-driver-master

7. Compile it.

export PATH=$PATH:~/local/bin/
sudo make install

After compiling you will get and copy to your php extension folder.


in php.ini.

Restart apache.

sudo apachectl restart
comments powered byDisqus