PHP MongoClient Class not found after installation

I am using the MongoClient class to access a MongoDB.
[php]$mongo = new MongoClient($conset[‘host’] . “:” . $conset[‘port’],$conset[‘host’]);[/php]
I get the fatal error Fatal error:

Class 'MongoClient' not found 

I installed the Mongo client using pear’s

pecl install mongo

and then add

extension=mongo.so to the php.ini. I restart my apache server and check to see if mongo is installed using pecl search mongo which returns mongo 1.5.5 (stable) 1.5.5 MongoDB database driver

However when I run the same php script it still returns the Fatal error. Why is this happening and how do I fix it?

I just called my VPS host (OVH) and they verified that they do not block any scripts or php extensions.

Well, never used the mongo client, but, found a lot of people have this same error.

Here is a link to one solution. ( You have to go almost to the bottom of the page under the
heading of Troubleshooting… )

Hope that helps! https://github.com/leroy-merlin-br/mongolid-laravel#troubleshooting

Sponsor our Newsletter | Privacy Policy | Terms of Service