Install MongoDB in Ubuntu 12.04 with PHP driver


Install MongoDB:

sudo apt-key adv --keyserver hkp:// --recv 7F0CEB10
echo 'deb dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install mongodb-10gen

Install MongoDB PHP driver:

sudo apt-get install php-pear php5-dev
sudo pecl search mongo
sudo pecl install mongo

The installation process has created a file called /etc/php5/conf.d/mongo.ini that loads the extension for MongoDB with PHP5.

Then restart Apache:

sudo service apache2 restart

Start, stop and restart MongoDB:

sudo service mongodb start
sudo service mongodb stop
sudo service mongodb restart

Configuration file:


Log file:


Data files:



You might also like

Fix “following signatures couldn’t be verified because the public key is not available” in Ubuntu
If you get a message like this when updating with apt-get:W: GPG error:

Install MongoDB and the PHP driver in CentOS
Install MongoDB serverCreate the /etc/yum.repos.d/mongodb-org-3.0.repo file with this content:name=MongoDB...

Install script for XBMC in Raspbian
# Install XBMC sudo sh -c "echo 'deb wheezy contrib' > /etc/apt/sources.list.d/mene.list" sudo...

Install and configure MongoDB and PHP driver with MacPorts
Installing and configuring MongoDB with MacPortsInstalling MongoDB with MacPorts is as easy as...

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.