Install the Mongo PHP driver on debian

debian on driver PHP Mongo the Install

Setup PECL

PECL is a repository for PHP extensions (similar to Node’s npm or Ruby’s gem). You might already have this setup, but run the following anyway:

sudo apt-get install php5-dev php5-cli php-pear

Install the MongoDB driver

With PECL setup it’s super easy to install the driver:

sudo pecl install mongo

Enable the module

Your almost ready to go! Now we just need to enable the module. Edit your php.ini file and add the line:

extension=mongo.so

Save your script and restart your webserver. You should now be able to use MongoDB with PHP. You can check to make sure the MongoDB driver is loaded by looking at the output of phpinfo(). You should see a section titled “mongo” if the driver has been loaded.



Saving the comment

Add comment

Required Please choose another name

biuquote
  • Comment
  • Preview
Loading

192.168.15.197