无法写入会话数据,php和memcached [英] Failed to write session data, php and memcached
问题描述
我最近尝试了实现memcached以便将会话保存在php中. 我在php.ini中修改了session.save_handler,并且在大多数情况下可以正常工作.会话被保存在其中.但是,有时我会在某些会话中收到以下奇怪消息:
I have recently tried implementing memcached for session saving in php. I modified the session.save_handler in my php.ini and for the most part it works correctly. Sessions are saved in it. However, once in a while, I get this weird message for certain sessions:
PHP警告:未知:无法写入会话数据(memcached).请在第0行的未知"中验证session.save_path的当前设置正确(x.x.x.x:11211).
PHP Warning: Unknown: Failed to write session data (memcached). Please verify that the current setting of session.save_path is correct (x.x.x.x:11211) in Unknown on line 0.
会话数据是相同的,但在1MB的内存缓存之下,我还没有看到此消息的出现模式……也许每分钟几次.该网站通常处于中等负载,并发150个用户.
The session data is the same, way under the 1MB barrier of memcached and I have yet to see a pattern in the occurences of this message... maybe a couple of times every minute. The website is usually under medium load, 150 users concurrently.
推荐答案
如果您使用的是内存缓存,则save_path
必须具有tcp://
前缀.
If you are using memcache then save_path
must have the tcp://
prefix.
如果您使用的是 memcached ,则save_path
不应具有tcp://
前缀.
If you are using memcached then the save_path
should not have the tcp://
prefix.
这篇关于无法写入会话数据,php和memcached的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!