Solution of Class ‘MongoClient’ not found in php

You have not installed MongoDB PHP driver please see this link

Update sources

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

Install MongoDB PHP Driver

sudo apt-get install php5-dev php5-cli php-pear -y sudo pecl install mongo

Open your php.ini file and add to it:

Restart apache

sudo /etc/init.d/apache2 restart

Other helping info:

this should help to find your php.ini file:

php -i | grep 'Configuration File'

On Ubuntu it shows this:

Configuration File (php.ini) Path => /etc/php5/cli Loaded Configuration File => /etc/php5/cli/php.ini

take a note, that you run this command from cli (command line) so for your true php.ini go to folder apache2 instead of cli 🙂



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Up ↑

%d bloggers like this: