标签:save evel ssi dev clu https 页面 str path
本实例基于phpredis 2.2.8,支持集群处理,php5.3及以上。
1、页面修改:
ini_set(‘session.save_handler‘, ‘rediscluster‘);
ini_set(‘session.save_path‘, ‘seed[]=192.168.100.1:7000&seed[]=192.168.100.1:7001&timeout=3&read_timeout=3‘);
2、修改php.ini
;session.save_handler = files
;session.save_path = "/var/lib/php/session"
注释上面两行,新增下面两行:
session.save_handler = rediscluster
session.save_path = "seed[]=192.168.100.1:7000&seed[]=192.168.100.1:7001&timeout=3&read_timeout=3"
3、php-fpm配置,修改fpm配置文件www.conf(该配置文件名不一定就是这个,根据实际情况修改)
;php_value[session.save_handler] = files
;php_value[session.save_path] = /var/lib/php/session
注释上面两行,添加下面内容:
php_value[session.save_handler] = rediscluster
php_value[session.save_path] = "seed[]=192.168.100.1:7000&seed[]=192.168.100.1:7001&timeout=3&read_timeout=3"
修改后重启php-fpm
官网地址:https://github.com/phpredis/phpredis/blob/develop/cluster.markdown#readme
标签:save evel ssi dev clu https 页面 str path
原文地址:http://www.cnblogs.com/hlsblog/p/8004652.html