I get the following error when trying to run a PHP script that access local MongoDB:
Fatal error: Class 'MongoDB\Driver\Manager' not found".
I have setup apache (2.4.23), along with PHP (5.6.25) and MongoDB (2.4.14) and a MongoDB driver (1.1.0). Everything seems to be working from the command line (cli), but when I try to access the DB via the web I get an error saying "
Fatal error: Class 'MongoDB\Driver\Manager' not found".
I am aware that php.ini has a special configuration file for apache (/etc/php5/apache2/php.ini), and I have enabled the mongodb.so extension there. However, I am still getting that error. I double checked that php is actually reading the configuration from there:
Configuration File (php.ini) Path /etc/php5/apache2 Loaded
Configuration File /etc/php5/apache2/php.ini Loaded
According to the MongoDB website ( https://docs.mongodb.com/ecosystem/drivers/driver-compatibility-reference/#reference-compatibility-mongodb-php), MongoDB (2.4) is compatible with mongoDB php Driver version 1.1. Again, from the command line, my test script works:
<?php
echo phpinfo();
$manager = new MongoDB\Driver\Manager("mongodb://localhost:28124");
Any Ideas?!?!?!?
new \MongoDB\Driver\Manager(...)(note the leading backslash). This probably won't change anything but it's worth a shot - Phil