mongoDB-Datasource
mongoDB-Datasource copied to clipboard
Fatal error: Class 'Mongo' not found in /var/www/webroot/ROOT/lib/Cake/Model/ConnectionManager.php on line 102
Double-check that the MongoDB PHP driver is installed and the extension is being loaded by PHP. You should have a mongo section in your phpinfo() output.
@eubruno did this help? you can fo a php -i | grep mongo in the command line or create a phpinfo() page. do not forget to restart your web server after installing the MongoDB PHP driver.
I was using MongoDB with PHP successfully on Ubuntu 12.10. This error started coming when I updated to Ubuntu 14.04. But, I am getting this error only when running a CRON through shell. I am sure MongoDB and PHP were also updated in the process. I read somewhere that now, the plugin needs to be installed for cli too. Is that correct?
not entirely correct. The plugin should not need any further customization to work on the command line. However, there are a few things you as the programmer need to make sure of:
- The CLI PHP and the PHP for the webserver might be pointing to different PHP versions
- The CLI PHP and the PHP for the webserver might be pointing to different php.ini files
- Depending on your app setup, some variables ( especially those sent by the server ) are not available via CLI. For example: my database config was being set via an environment variable sent by Apache. When I tried to run certain CakeShell scripts I would get errors because those vars where not being sent.
I would suggest you first verifying that your php CLI and your webserver's php match up.