Reputation: 5842
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:
Install mongodb, following the instructions here -> install mongodb community edition on ubuntu
installed the php mongodb driver using pecl install mongodb
extension=mongodb.so
to php.ini at etc/php5/cli/php.ini
$ mongo
What am I missing here, Please?
PS: the API is developed using Phalcon
Upvotes: 1
Views: 1481
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