web analytics

PHP cannot access MongoDB, you need to install the Mongo extension for PHP.

When you access the phpMoAdmin to manage your mongo databases, sometimes you may get the following error.

PHP cannot access MongoDB, you need to install the Mongo extension for PHP.”

This is because mongo is installed, but the mongo extension for php is not installed. You can install it using pecl.

pecl install mongo

Once it finishes, add the mongo.so file to your php.ini and restart apache.

You can find your php.ini as follows.

php -i | grep ini and check for the following line

“Loaded Configuration File => /usr/local/lib/php.ini”

Now open that file and make the changes

vi /usr/local/lib/php.ini

Add the following down to any already present extensions

extension=”mongo.so”

/etc/rc.d/init.d/httpd restart

Now clear the browser cache and try accessing the phpMoAdmin once again, it should work.

One comment to PHP cannot access MongoDB, you need to install the Mongo extension for PHP.

  • louis vuitton outlet online  says:

    I wish to convey my affection for your generosity giving support to people that really want help on this one niche. Your personal dedication to getting the solution up and down was especially beneficial and has regularly enabled workers like me to get to their pursuits. This informative help entails a lot to me and further more to my peers. Many thanks; from all of us. louis vuitton outlet online http://www.linuxhostingtalk.com/memberlist.php

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>