Reputation: 328
I've just installed PHP 5.5 and I am no longer able to use MongoClient and I'm getting frustrated trying to figure out why.
This doesn't work:
$m = new MongoClient("mongodb://workplz.com");
My nginx error log shows:
2013/07/05 10:40:16 [error] 4163#0: *698 FastCGI sent in stderr: "PHP message: PHP Fatal error: Class 'MongoClient' not found in /blah/test.php on line 2" while reading response header from upstream, client: 123.123.123.123, server: blah, request: "GET /test.php HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php5-fpm/freecookies.sock:", host: "blah"
I do have extension=mongo.so
in my php.ini.
When I do phpinfo() it shows under Mongo Version 1.4.1
Extra info:
When I try to execute it from php-cli I get the same thing:
PHP Fatal error: Class 'MongoClient' not found in /blah/test.php on line 2
Upvotes: 2
Views: 3445
Reputation: 522626
Double check your php.ini, you're probably using the wrong one. There are several for different ways to invoke PHP.
Upvotes: 2