How To install MongoDB in ubuntu?

How To install MongoDB in ubuntu  

step1: Open the terminal login with root and copy the given code past in terminal

apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" | tee -a /etc/apt/sources.list.d/10gen.
list
apt-get -y update
apt-get -y install mongodb-10gen


step2:
$ sudo service mongodb start


******************** setup with php ***************
step 1: sudo apt-get install php5-dev php5-cli php-pear
step2 : sudo pecl install mongo
step3: open php.ini "/etc/php5/apache2/php.ini"
and set "extension=mongo.so"
step4: service apache2 restart

Now php with mongodb is ready for work.

Comments