I am creating REST APi with Lumen framework. I use Mongolab for my mongoDB and i want to host my app on google App Enginge. I am using Jessenger lib for communicating with my DB on MongoLab. Everhting is okay when I run the app localy but when I deploy on GAE I get

Fatal error: Class 'MongoDB\Driver\Manager' not found in /base/data/home/apps/s~lumentestapi/v1.391053224987814328/ vendor/mongodb/mongodb/src/Client.php on line 56

I have enabled

extension = mongo.so

in the php.ini located in root.

Any help how can I fix this?


Are you using the new mongodb driver rather than the mongo driver?

If so you should use:


in your php.ini file instead.

(I had that issue myself recently while upgrading our servers)

| improve this answer | |

Make sure you init driver class as below

$manager = new MongoDB\Driver\Manager("mongodb://localhost");
$collection = new MongoDB\Collection($manager, "logs","capped_logs");
| improve this answer | |

If you're using PHP7.*. with Ubuntu, you can do the following:

sudo apt update && sudo apt install php-mongodb

This assumes you installed the library via composer require mongodb/mongodb

Then remember to restart your app's server. Check phpinfo() for mongo.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.