ichikaway / mongoDB-Datasource

Old and Historical repository. Please use new repository at: http://github.com/ichikaway/cakephp-mongodb
85 stars 28 forks source link

Fatal error: Class 'Mongo' not found in /var/www/webroot/ROOT/lib/Cake/Model/ConnectionManager.php on line 102 #12

Open brunonunes opened 10 years ago

chrisvogt commented 10 years ago

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.

angelxmoreno commented 10 years ago

@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.

gurpreet-singh-sf commented 9 years ago

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?

angelxmoreno commented 9 years ago

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:

  1. The CLI PHP and the PHP for the webserver might be pointing to different PHP versions
  2. The CLI PHP and the PHP for the webserver might be pointing to different php.ini files
  3. 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.