Reputation: 6788
I have installed drupal on my localhost. It worked well 2 months ago, but now something happened and I don't know why. I'll be very grateful if you can help me. Thanks in advance.
The full error looks like this:
Fatal error: Class 'Memcache' not found in /srv/www/htdocs/modules/memcache/dmemcache.inc on line 177
1) php -m gives this:
[PHP Modules]
bz2
ctype
date
dom
filter
gd
hash
iconv
json
libxml
mbstring
mcrypt
mysql
mysqli
pcre
PDO
pdo_mysql
pdo_sqlite
Reflection session SimpleXML SPL SQLite standard sysvsem tokenizer xml xmlreader xmlwriter zip zlib[Zend Modules] none
2) memcached is installed through package manager.
3) memcache module for drupal installed
what am I doing wrong? thx.
Upvotes: 4
Views: 9589
Reputation: 99533
It might be enough to just add extension=memcached.so
to your php.ini
. The location of this file can be found using phpinfo();
Make sure you restart apache afterwards.
Upvotes: 0
Reputation: 46
A co-worker helped me today with this issue, I use Drupal & Drush (command line tool), and sometimes MAMP.
Try:
echo $PHPRC
If it comes up blank then save this in your ~/.profile or your *~/.bash_profile* config file:
export PHPRC='/Library/Application Support/appsolute/MAMP PRO/conf/php.ini'
Upvotes: 3
Reputation: 6788
Thank you very much for your answers -- I've eventually managed with this problem. Here's the solution as for openSUSE 11.1.
Install memcache extension for php:
#if apt-get, rpm, or yum doesn't work
cd /usr/src/
wget http://pecl.php.net/get/memcache-2.2.5.tgz
tar -zxvf memcache-2.2.5.tgz
cd memcache-2.2.5
phpize5
./configure --enable-memcache
make
make install
cp modules/memcache.so /usr/lib/php5/extensions/
# Note: packaged extension modules are now loaded via the .ini files
# found in the directory /etc/php5/conf.d/
touch /etc/php5/conf.d/memcache.ini
echo 'extension=memcache.so' > /etc/php5/conf.d/memcache.ini
now you should restart apache2 service
Install memcached daemon for php and run it as a daemon.
Install memcache plugin for drupal (all instructions here: http://drupal.org/project/memcache)
UPD. be carefull with upgrading PHP: intalled modules might not be working well with new version -- you should recompile them. but somehow "pear install -f pecl/memcache" did the trick for me :)
Upvotes: 1
Reputation: 982
my take is that memecache may be installed on your machine, but it's not correctly compiled with PHP had this issue before with memecache. check here for more details
Upvotes: 0
Reputation: 43031
I convene with googletorp that the problem seems to rely on memcache installation. Try this:
#if apt-get, rpm, or yum doesn't work
cd /usr/src/
wget http://pecl.php.net/get/memcache-2.2.4.tgz
tar -zxvf memcached-2.2.4.tgz
cd memcached-2.2.4
phpize && ./configure --enable-memcache && make
cp modules/memcache.so /usr/lib/php/modules/
# Note: packaged extension modules are now loaded via the .ini files
# found in the directory /etc/php.d
touch /etc/php.d/memcached.ini
echo 'extension=memcache.so' > /etc/php.d/memcached.ini
service httpd restart
The above procedure has been brutally copied from the comments to the page of the official memecache documentation. It is dated 11.12.09.
Upvotes: 4
Reputation: 33275
It seems your memcache drupal module is expecting a class to be available in the inc file mentioned.
It looks like it's the drupal module that's the problem. My guess an upgrade went wrong.
EDIT:
I Took at look at the module, I was on my iphone, so couldn't look through the code. Your problem is that Drupal can't find the Memcache class. This fix is defined in step two of the installation process.
2. Install the PECL memcache extension for PHP. This must be version 2.2.1 or higher or you will experience errors.
Either you are missing this now, or something is wrong with the installation. In any regard, Drupal can't find the Memcache
that is defined in this extension, and that is why you get the fatal error.
Upvotes: 0