1

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?

3 Answers 3

0

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

If so you should use:

extension=mongodb.so

in your php.ini file instead.

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

2

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.

1
  • If it helps anyone else, only this has helped me solve the issue on Ubuntu 20.04 LTS nginx php8.0-fpm production server Feb 18, 2021 at 9:49
1

Make sure you init driver class as below

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .