NGINX + PHP-FPM 5.7.12

I'm trying to set my session handler to memcache, so I installed the module php-memcache, opened /etc/php.ini and changed the following lines:

session.save_handler = memcache
session.save_path = "tcp://MEMCACHESERVERIP:11211?persistent=1&weight=1&timeout=1&retry_interval=15"

So I restart nginx, php-fpm, open a page with phpinfo(); and at the session section I see session.save_handler = files at the Master and Local Value

Then I run the command at the ssh php-fpm -i | grep session.save and I receive session.save_handler => memcache => memcache session.save_path => tcp://MEMCACHESERVERIP:11211?persistent=1&weight=1&timeout=1&retry_interval=15 => tcp://MEMCACHESERVERIP:11211?persistent=1&weight=1&timeout=1&retry_interval=15

Then my last option is to go to the nginx error log see if there is any error and I see PHP trying to save the session in the disk

does anyone know what should I do? Definally php is not saving my sessions at the memcache server.


Found the solution for PHP-FPM you should set session.save parameters at /etc/php-fpm.d/www.conf, not at /etc/php.ini

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.