61 posts / categories / feed

MongoDB with MAMP on OS X

In order to start running MongoDB with PHP, there is a need to install MongoDB PECL Module.

Ensure that you have your MongoDB setup and installed correctly. If not, proceed to MongoDB Installation on OS X to start installing first.

  1. Download the MongoDB driver for OS X from the github.
  2. Unzip and Extract the mongo.so to:
  3. /Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-DATESTAMP
    

    where DATESTAMP could be 20090626 etc.

  4. Open your php.ini file and add the following:
  5. sudo vi /Applications/MAMP/conf/php5.3/php.ini
    
  6. Search for Extensions (Dynamic Extensions) and add to the list:
  7. extension=mongo.so
    
  8. Restart MAMP
  9. Check phpinfo()

Reference:
http://mattgeri.com/blog/how-to-install-the-mongodb-pecl-extension-on-mamp/
http://en.saturngod.net/blogpost/mongo-db-with-mac
http://jermainemaree.com/blog/install-mongo-php-driver-in-mamp