Pila
Pila

Reputation: 5842

Fatal error: Class 'MongoDB\Driver\Manager' not found in /srv/www/api/releases/...vendor/mongodb/mongodb/src/Client.php

I am trying to configure MongoDB on the AWS server, but when I try to make an API call, I get the following error:

Fatal error: Class 'MongoDB\Driver\Manager' not found in /srv/www/api/releases/20160912135146/vendor/mongodb/mongodb/src/Client.php on line 56

I have done the following:

What am I missing here, Please?

PS: the API is developed using Phalcon

Upvotes: 1

Views: 1481

Answers (1)

Pila
Pila

Reputation: 5842

I finally found a solution to this. Apparently, the apache server uses a special php.ini file, different from etc/php5/cli/php.ini. This file is located in etc/php5/apache2/php.ini. After installing the mongodb driver using pecl install mongodb, your extension should go in etc/php5/apache2/php.ini i.e add extension = mongodb at the end of etc/php5/apache2/php.ini. Good luck

Upvotes: 3

Related Questions