Closed (fixed)
Project:
MongoDB
Version:
7.x-1.0-rc1
Component:
Cache
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Apr 2012 at 01:47 UTC
Updated:
5 Aug 2012 at 16:48 UTC
Jump to comment: Most recent
Installed Mongo on my machine, and enabled Mongo/Mongo Cache/Mongo Field Storage (using this tutorial http://groups.drupal.org/node/183279). When I use drush, I get this error everytime:
Fatal error: Class 'Mongo' not found
When I comment out the cache settings in settings.php, drush works. How can I work around this and still use Mongo Cache?
Comments
Comment #1
fgmIt looks like you did not enable the mongodb extension in PHP, which is not automatic when you install mongodb itself.
The module should catch the missing extension, though. It already checks for its presence in hook_requirements() but cache plugins run without a hook_requirements() check. Adjusting issue title accordingly
Comment #2
kevinquillen commentedWeird, I have extension=mongo.so in my php.ini, and see it enabled in phpinfo.
Comment #3
kevinquillen commentedLet me clarify, I can create nodes and fields and see them appear in my mongo database. Its when I try to use Mongo Cache module that drush breaks.
Comment #4
misc commentedWhich settings are you using for the MongoDB cache in settings.php?
Comment #5
kevinquillen commentedsettings.php:
Comment #6
misc commentedcache_backends does not work for me either (see http://drupal.org/node/1413178), add:
(If you mongodb is in the sites all...)
EDIT: sorry, removed #...
Comment #7
misc commented@Kevin Quillen see: #1514556: Example settings for cache in README.txt does not work
You should remove:
And:
To get
To work.
Comment #8
misc commentedChanged back the title, because of the error is not missing mongodb extension (but we need a check for that, started work for that in #1514698: Check requirements for Mongodb cache)
Comment #9
misc commented@Kevin Quillen did it work for you?
Comment #10
misc commentedComment #11
misc commentedMarked is fixed in lack of response.
Comment #13
pwaterz commentedI am also getting this error. I greped the code for 'class Mongo' and found nothing. On line 32 of mongodb.module you call
$mongo = new Mongo($host);Comment #14
pwaterz commentedAhh I just realized that is supposed to come from the php extension. AHHH...I am missing extension=mongo.so in my php cli php.ini
Comment #15
pwaterz commentedThis is really off topic, but the install.txt for this module could use some work.
Comment #16
misc commented@pwaterz, have you checked the README.txt in the latest dev?
Comment #17
Anonymous (not verified) commentedHi, I keep getting this issue when trying to run 'drush mongodb-migrate-prepare'.
Running drush on Windows 7 from the drush installer for windows. I run drush in the root of my drupal site.
MongoDB PHP is loaded, working and seen in phpinfo().
But for some reason, running drush does not load the mongodb php?
Could it be 32bit / 64bit conflict? My PHP/mongo is 64 bit, but I think drush-for-windows is 32 bit?
Comment #18
fgmMore likely you are not using the same php.ini for drush (CLI SAPI) and web (on Windows, probably ISAPI or FASTCGI SAPI): if your php.ini for CLI does not load mongo.so that makes sense.
Can you check "php -i" from the command line to see if the Mongo is loaded ?
Comment #19
Anonymous (not verified) commentedPHP CLI of course. Drush for windows has its own PHP with php.ini
Comment #20
fgmThat's a good start: but does that php.ini load the Mongo extension ?
On Debian, all php.ini default to loading from the conf.d directory and there's a mongo.conf there, so the extension is always loaded whatever the SAPI. But maybe this is different on Windows ? When you run php -i, do you see the mongo extension listed ?
Comment #21
couloir007 commentedI'm running Ubuntu and was getting this error trying to drush cc all. I did this:
sudo ln -s /etc/php5/mods-available/mongo.ini /etc/php5/cli/conf.d/mongo.iniand now all is well.