I am having a strange problem, since i have upgraded PHP from 5.4 to 5.6. I have never seen the error myself, but the logs a full every day with this message:
session_write_close(): Failed to write session data (memcached). Please verify that the current setting of session.save_path is correct (127.0.0.1:11211)
This does no happens always, but only for certain users. And this happens on three different servers that have PHP ~5.6 & Memcached on latest Debian. I have tried switching Memcached extension to Memcache (of course with changing save_handler in php.ini), and the problem still persisted. I have also tried disabling session lock in php.ini. The problem is definitely related to PHP, because I have tested Memcached daemon itself with a Perl script, and there was not a single connection error.
Everything was working perfect for a very long time, and I started having this problem right after PHP upgrade, so it's not related with memcached config, or something like this. Maybe I am missing something? Maybe 5.6 requires some additional configs in its ini file? I just cant figure it out.
At the moment I am kind of stuck, and I hope anyone can help me with advice. I can try switching back to 5.4, or to 5.5, but that's not really an option, I would really like to stick to 5.6.
There are 2 Extension for php, memcache and memcached.
memcached extension is based on libmemcache, and you should prefer that one anyway.
In my experience current versions of the memcache daemon did not play nice with the memcache extension. Storing data worked, but I've experienced substantial performance issues for writing data into the session after the first request (first request for completely new session was fine and fast, every following request took up to 10 seconds !). Replacing memcache with memcached fixed this particular problem.
Warning: The syntax for session.save_path
for memcached was slightly different. I had to ommit the tcp://
or it would not work
So for memcached use:
session.save_path = "127.0.0.1:11211"
And for memcache use:
session.save_path = "tcp://127.0.0.1:11211"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With