0

In EE 2.8 and above, you can select 'Memcached' as your 'Caching Driver' under "Admin" => "General Configuration".

I am using one of Nexcess' "ExpressionEngine optimized" hosting plans, which lists "Memcached Back-End" as one of their features. I wanted to enable this, so I contacted their support folks. They set up a socket to use memcache.

However, when I select 'Memcached' as my caching driver, EE displays the error message "Cannot connect to Memcached, using File driver instead".

What is the correct syntax for my config file to get this to work?

1

I'm glad you asked!

$config['cache_driver'] = 'memcached';
$config['memcached'] = array(
  array(
    'host' => '/var/tmp/memcached.sock',
    'port' => 0,
    'weight' => 1,
  )
);

Adding that to your config.php should do the trick, assuming you list the correct socket location and port.

(this is me answering my own question, because I searched and searched and couldn't find this info anywhere.)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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