Cedric
Cedric

Reputation: 5303

Fatal error: Class 'Memcached' not found in /my/path

When I try :

$mc= new Memcached();

I get

Fatal error: Class 'Memcached' not found in /my/path

phpinfo says that /etc/php5/apache2/conf.d/20-memcached.ini is loaded as an additional .ini file.

The content of this file is this one :

; uncomment the next line to enable the module
extension=memcached.so

dpkg --get-selections | grep memcached

libmemcached6                                   install
memcached                                       install
php5-memcached                                  install

Kubuntu Apache 2.0 php 5.4.4-1

Why do I have this fatal error ?

Upvotes: 4

Views: 16369

Answers (1)

zambesianus
zambesianus

Reputation: 1249

Based on your comment I don't think you have it installed properly. Make sure you see a see a section in phpinfo() such as:

memcached
memcached support   enabled
Version     x.x.x
libmemcached version    x.xx

1) Get libmemcached

2) Configure the package

3) Make install sudo make install libmemcached

4) Try Installing with Install with sudo pecl install memcached

5) make sure you have extension = memcached.so in your php.ini

Restart Apache

Upvotes: 6

Related Questions