Magento2: Class 'MongoDB\Driver\Manager' not found
-
14-04-2021 - |
Question
On running di:compile command I am getting the following error:
Fatal error: Uncaught Error: Class 'MongoDB\Driver\Manager' not found in /var/www/html/monotaro/vendor/mongodb/mongodb/src/Client.php:116
Stack trace:
#0 /var/www/html/monotaro/vendor/monotaro-global/mongo/module-mongo-core/Model/Client/ClientFactory.php(37): MongoDB\Client->__construct('mongodb://mage_...', Array, Array)
#1 /var/www/html/monotaro/vendor/monotaro-global/mongo/module-mongo-core/Model/Db.php(66): MonotaROGlobal\MongoCore\Model\Client\ClientFactory->create(Object(MonotaROGlobal\MongoCore\Model\Client\FactoryOptions))
#2 /var/www/html/monotaro/vendor/monotaro-global/mongo/module-mongo-core/Model/Db.php(76): MonotaROGlobal\MongoCore\Model\Db->getConnection()
#3 /var/www/html/monotaro/vendor/monotaro-global/mongo/module-mongo-core/Model/Adapter/Adapter.php(25): MonotaROGlobal\MongoCore\Model\Db->getDb()
#4 /var/www/html/monotaro/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(121): MonotaROGlobal\MongoCore\Model\Adapter\Adapter->__construct(Object(MonotaROGlobal\MongoCore\Model\Db))
#5 /var/w in /var/www/html/monotaro/vendor/mongodb/mongodb/src/Client.php on line 116
MongoDB driver is already installed and running on my local system
Solution
Sorry can't comment yet, but have you check if the requested class MongoDB\Driver\Manager
were really existing in the module ? It would not be the first time I encounter a contributor module with location errors, also check you are using the contributor stable version of the module.
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange