Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drupal — Fatal error: Class 'Memcache' not found

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.

like image 486
soshial Avatar asked Feb 27 '23 22:02

soshial


1 Answers

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.

like image 96
mac Avatar answered Mar 08 '23 09:03

mac