简体   繁体   English

为什么PHP Sessions Memcached可以工作,但Memcache不能工作?

[英]Why PHP Sessions Memcached works but Memcache doesn't?

I'm trying to figure out what's wrong for hours, 我试图找出几个小时出了什么问题,

<?php
ini_set("session.save_handler","memcached");
ini_set("session.save_path","127.0.0.1:11211");

session_start();
print "Session started..\n<br />\n";
?>

Will print but if it's "memcache" notice the "d" it will not work + fire the error in php-fpm 将打印,但是如果它是“ memcache”,则注意到“ d”将不起作用+触发php-fpm中的错误

php -i | grep memcach

memcache
memcache support => enabled
memcache.allow_failover => 1 => 1
memcache.chunk_size => 32768 => 32768
memcache.compress_threshold => 20000 => 20000
memcache.default_port => 11211 => 11211
memcache.hash_function => crc32 => crc32
memcache.hash_strategy => consistent => consistent
memcache.lock_timeout => 15 => 15
memcache.max_failover_attempts => 20 => 20
memcache.protocol => ascii => ascii
memcache.redundancy => 1 => 1
memcache.session_redundancy => 2 => 2
Registered save handlers => files user memcache redis

php.ini set as following: php.ini设置如下:

session.save_path = "/var/lib/php/session"
session.save_handler = files

error in php-fpm php-fpm中的错误

 PHP Fatal error:  session_start(): Failed to initialize storage module: memcache (path: /var/lib/php/session) in /home/webs/pricegoto.com/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 125

Try some thing like this : 试试这样的事情:

ini_set('session.save_handler', 'memcache');
ini_set('session.save_path',
'tcp://localhost:11211?persistent=1&amp;weight=1&amp;timeout=1&amp;retry_interval=15');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM