How-to Install PHP 5 MongoDB Extension on Mac Mavericks 10.9 OS X Step-by-Step Easy Guide

April 17th, 2014 by Mark Goo

Enabling PHP MongoDB Support for Mac OS X




The Tutorial Simply Shows You Step-by-Step How-to Install the PHP 5 MongoDB Database Extension by PECL on Mac 10.9 Mavericks OS X.

MongoDB (from “humongous”) is an Open-Source Document Database written in C++, and the leading NoSQL database.

PECL is short for “PHP Extension Community Library“. PECL Extensions are also distributed as packages and can be installed using the PEAR installer with the PECL command.

Installing MongoDb PHP Pecl Extension for Mac OS X - Featured
  1. Open Terminal Window
    (Press “Enter” to Execute Commands)

    Installing MongoDb PHP Pecl Extension for Mac OS X - Open Terminal
  2. Installing Required autoconf Package by MacPorts

    sudo su

    If Got “User is Not in Sudoers file” then Look: Solution

    port install autoconf

    How-to Install MacPorts on Mac 10.9 Mavericks:

    Getting-Started with MacPorts
  3. How-to Install/Enable Pear/Pecl Command on Mac OS X:

    PHP PEAR+PECL for Mac OS X
  4. Installing PHP 5 MongoDB Extension

    pecl install mongo
  5. Enabling PHP 5 MongoDB Extension

    nano /[path/2]/php.ini

    On the Extensions Section Add:

    extension=mongo.so

    Ctrl+x to Save & Exit!

  6. Restart Apache to Load the PHP MongoDB Support

Tags: , , , , , , , , , , , , , ,