解决 php的session无法保存到redis
The session of PHP is written to the Redis configuration
Vim/etc/php-fpm.d/www.conf
user = Nginx
Group = Nginx
Php_value[session.save_handler] = Redis
Php_value[session.save_path] = ' tcp://192.168.1.2:6688 '
Php_value[soap.wsdl_cache_dir] =/var/lib/php/wsdlcache
Vim/etc/php.ini
Session.save_handler = Redis
Session.save_path = "tcp://192.168.1.2:6688"
But when I refresh the verification code, I look at the Redis key value is, found to be empty, did not write inside
Connect to Redis to see the session key value
Redis-cli-h 192.168.1.2-p 6688
192.168.1.2:6688> Keys * #查看所有key值
(empty list or set)
192.168.1.2:6688> quit #退出
Rpm-qa |grep PHP, found the installation of the Redis Extension Pack for PHP installed is php70-php-pecl-redis-3.1.6-1.el6.remi.x86_64
And the version I installed was php70w.
Workaround:
Yum Search php70w
Yum Install Php70w-pecl-redis.x86_64-y
The session that resolves PHP cannot be saved to Redis