I'm trying to install the MongoDB PHP driver Using PHP 7.2 on AWS EC2 Ubuntu.
I used sudo pecl install mongodb
. it seems to have installed without any errors.
However, when loading phpinfo() I don't see any reference to Mongo. When I try to run:
$manager = new MongoDB\Driver\Manager("mongodb://localhost:27017");
Fatal error: Uncaught Error: Class 'MongoDB\Driver\Manager' not found in /var/www/html/website/test.php:3 Stack trace: #0 {main} thrown in /var/www/html/website/test.php on line 3
I did put in extension=mongodb.so into my php.ini
I'd appreciate assistance as to why this isn't working.
phpinfo()
and check for mongo db. You also need to restart the server after changing php.ini – Sameer Reza Khan