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.