I'm getting the below error when I run the following PHP:

$mem = new Memcached();
$mem->addServer("", 11211);

$result = $mem->get("blah");

if ($result) {
    echo $result;
} else {
    echo "No matching key found.  I'll add that now!";
    $mem->set("blah", "I am data!  I am held in memcached!") or die("Couldn't save anything to memcached...");

And the error:

[Mon Nov 13 10:14:44.751598 2017] [proxy_fcgi:error] [pid 8091:tid 140212336183040] [client] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught Error: Class 'Memcached' not found in /opt/bitnami/apps/magento/htdocs/cache-test.php

I ran

ps wuax | grep memcached

And can see Memcached on localhost 11211.

Just trying to configure Memcached to control all the session files in Magento 2 and was running a test to seem if it is all configured properly. If Memcached is installed then why the error, could anybody point me in the right direction?

1 Answer 1


Check if you have the memcached extension installed and enabled for the php version that you're using. Also if it is correctly configured in the php.ini file (it could be looking in the wrong directory).

$ php -m | grep memcached

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.