Need help configuring Magento2 to use memcached for session storage on Ubuntu 16.04 running PHP7.0.4 FPM with php7.0-memcached build from php-memcached-dev github. I wonder what went wrong this time. :D

From phpinfo:

memcached support enabled
Version 3.0.0b1

My env.php:

'session' =>
   array (
      'save' => 'memcached’,
      'save_path' => 'localhost:11211',

I always get this error when following Magento2 docs to configure Magento2 to use memcached in app/etc/env.php:

stderr: "NOTICE: PHP message: PHP Parse error:  syntax error, unexpected 'save_path' (T_STRING), expecting ')'


1 Answer 1


The problem is not memcached, but a small typo in your code:

'session' =>
   array (
      'save' => 'memcached ⇨’⇦,
      'save_path' => 'localhost:11211',

You used a single quote ' at the beginning of the memcached string and and an acute accent ´ at the end.

That's the reason for the PHP parse error.

  • Hi @AndreasKoch, thanks for pointing that out. Fix the ` did it! :D
    – chrone
    Apr 30, 2016 at 17:16

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.