Ivan Tomica

Redis as PHP session handler on FreeBSD

This one is quite simple to be honest. Assuming you have Redis already installed and set up correctly you can just change your php-fpm pool definition to include:

php_value[session.save_handler] = redis
php_value[session.save_path]    = "tcp://"

If you’re using password for logging into redis you would specify it like:

php_value[session.save_path]    = "tcp://"

Restart php-fpm after that:

service php-fpm restart

and you should now see PHP saving sessions within Redis service:> keys PHPREDIS_SESSION*
Tagged in:,
Sysadmin on the everlasting journey of learning.


Leave a Reply

Your email address will not be published. Required fields are marked *