2013-11-06

Mongo DB with PHP on Ubuntu

1.  Install Mongodb
Download the project from GitHub
 unzip mongo-php-driver-master.zip
 cd mongo-php-driver-master
 phpize
 ./configure
 make all
 make test
 sudo make install
2.  If the installation is successful, then you will see
Installing shared extensions:   /usr/lib/php5/2009XXXXX
3.  Make sure that it's the same as the PHP extension directory
php -i | grep extension_dir
   extension_dir => /usr/lib/php5/2009XXXXX => /usr/lib/php5/2009XXXXX
   or you should modify the extension_dir in php.ini 4.  modify php.ini with following line
vi /etc/php5/apache2/php.ini
    extension = mongo.so
 service apache2 restart
3.  starting the Mongod
service mongodb start
mongod --fork --log /var/log/mongod.log --dbpath /var/log/mongod/ ###run mongod in background

沒有留言: