Friday, August 12, 2011

Install MongoDB PHP driver on Debian 6 Squeeze

Install the server

apt-get install mongodb-server

Before install the PHP driver a couple of packages you'll need:

apt-get install php5-dev build-essential php-pear

Now time to compile/install the driver:

pecl install mongo

Once it finishes it will display the location of the new extension. Something like:


Finally add this to your php.ini (/etc/php5/cgi/php.ini):


Now restart your web server and that's should be it!