I'm struggling for days now, I'm setting up my cloud infrastructure: 1 nginx Loadbalancer 2 Centos Webservers 1 Centos Memcached server

On the webservers I've installed the php-pecl-memcached packages and made the necessary adjustments to php.ini. The webservers connect to the memcached server over a private network:

session.save_handler = memcached
session.save_path = "10.xx.xx.xx:11211"

The webservers are capable of connecting, tested it with telnet 10.xx.xx.xx 11211 and the memcached server is able to output the statistics when you type stats.

Now trying to check if Memcached works as it should results in a PHP error:

HP Warning:  Unknown: Failed to write session data (memcached). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0, referer: https://example.com

It looks like the session.save_path as mentioned above isn't used, while it should be accessible, see telnet test.

  • Did you edit the correct php.ini? – Michael Hampton Feb 13 '16 at 17:53
  • Yes, see the first code block – Peter Fox Feb 13 '16 at 18:05
  • The code block doesn't answer my question. Remember that Ubuntu has several php.ini files; you must edit the correct one. – Michael Hampton Feb 13 '16 at 18:05
  • Ohkay, that maken sense. The webservers run on CentOs 6.5 and the /etc/php.ini has been adjusted. On the 'dedicated' memcached server there is no PHP installed. – Peter Fox Feb 13 '16 at 22:35
  • You tagged your question ubuntu. That makes things very confusing when you aren't actually using it! I've removed this tag. – Michael Hampton Feb 13 '16 at 22:39

Fixed! Seemed that there was another config file overriding the php.ini settings. Check the /etc/php.d/ folder for a memcached.ini file. Override the settings in this file.

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.