使用redis的PHP会话处理程序不起作用

我当时设置了3台服务器:

192.168.7.147:6379 <-- redis server 192.168.7.162 <-- web server 1 (using phpredis, with local devdomain jttest.com ) 192.168.7.218 <-- web server 1 (using phpredis, with local devdomain jttest.com ) 

两个192.168.7.162和192.168.7.218使用php.iniconfiguration完全一样的这些:

 extension=redis.so session.save_handler = redis session.save_path = tcp://192.168.7.147:6379 

也改变这些选项后,我也重新启动Apache和Redis的,当然,我可以在我的PHP代码中使用redis的基本function

问题从这里开始,我可以使用php标准会话调用(session_start())在192.168.7.162上login,但不能在192.168.7.218上检索会话,反之亦然,简单地说, redis会话不共享

里面192.168.7.147,我无法得到有关会议的关键(会话名称是PHPREDIS_SESSION),看看这些结果我从redis-cli

 redis 127.0.0.1:6379> keys * 1) "attribute" 2) "test" redis 127.0.0.1:6379> 

还有一件事,在192.168.7.218 php仍然使用文件保存会话,而不是使用redis

 [root@centos_wira_devel session]# ll total 8 -rw------- 1 apache apache 792 Feb 26 16:29 sess_1nm86s67o1o696cgopmrc2hq75 -rw------- 1 apache apache 792 Feb 26 16:41 sess_hhmompfoqjh0emoofppg4v5lp2 

有关信息,在我的浏览器中,保存为['PHPREDIS_SESSION'] = hhmompfoqjh0emoofppg4v5lp2的会话Cookie(包括192.168.7.162和192.168.7.218)

在页面phpredis我没有find任何有关这种情况下的常见问题( https://github.com/phpredis/phpredis ),我不知道我失踪的步骤。

其他configuration文件中的会话设置可能会更改,但php.ini除外。 这可能会被确认检查phpinfo()输出的“会话”部分。 如果“本地值”列中的值与“主值”列中的值不同,则必须检查其他文件。
特别是在Centos上,在服务器192.168.7.162上,很有可能在/etc/httpd/conf.d/php.conf中将session.save_handler设置为“files”。

在php-fpmconfiguration下也检查。 经过漫长的检查,我发现这一点。 如果你在linux上做grepfind你的configuration被修改的地方,比如grep -r "save_handler" /etc/它会做文本search并显示这些文件。

/etc/php-fpm.d/www.conf