0

I'm having an issue with a Wordpress plugin that i created. The plugin is supposed to connect to my mongodb atlas database and compare all the document's contents to the users form inputs, But when i upload and activate the plugin i get this Error:

Fatal error: Uncaught Error: Class "MongoDB\Driver\Manager" not found in C:\...\vendor\mongodb\mongodb\src\Client.php:126

The error is triggered in the mongodb connection string line

$mongoClient = new MongoDB\Client('mongodb+srv://XXXX:XXXX@cluster0.XXXX.mongodb.net/test?retryWrites=true&w=majority');

on my php file and is due to 'Manager' not being defined in 'C:\...\vendor\mongodb\mongodb\src\Client.php' I tried to import the class using use MongoDB\Driver\Manager; but it didn't work. There's the line : `

$this->manager = new Manager($uri, $uriOptions, $driverOptions);

NB: I've already installed and configured the mongodb php driver and the the library mongodb library. The Plugin works fine when i run it locally, but i get this error when i upload it and activate it on wordpress. Thanks in advance.

  • Does this answer your question? [Fatal error: Class 'MongoDB\Driver\Manager' not found](https://stackoverflow.com/questions/38766586/fatal-error-class-mongodb-driver-manager-not-found) – Wahyu Kristianto Mar 03 '23 at 16:24
  • Thanks for replying. I already tried that but i didnt work neither. The workaroud that i found is to install mongodb and the application on another instance and call it in wordpress wich worked fine. – Djnoname Mar 28 '23 at 14:32

0 Answers0