dotdeb-php icon indicating copy to clipboard operation
dotdeb-php copied to clipboard

/usr/lib/php5/sessionclean ignores session settings in /etc/php5/fpm/pool.d/*.conf

Open merlyel opened this issue 8 years ago • 4 comments

Distribution: Debian jessie Architecture: amd64 PHP version: 5.6.20-1~dotdeb+7.1 FPM

I create separate folders for session.path for every fpm pool in /etc/php5/fpm/pool.d/*.conf. For example: /etc/php5/fpm/pool.d/test1.conf:

php_value[session.save_handler] = files
php_value[session.save_path] = /srv/www/test.domain.tld/tmp

Unfortunately /usr/lib/php5/sessionclean does not see these settings as it only reads ini-files.

Would be great if sessionclean could find these additional configs

merlyel avatar Jun 28 '16 04:06 merlyel

Still the case with PHP 7.0.27-0+deb9u1. sessionclean is then totally useless if session.save_path is configured in pool.d/*.conf files. Thx 👍

benrubson avatar Apr 22 '18 12:04 benrubson

still an issue in php7.2, I just found out that I have no inodes left on my partition thanks to this..

martinellimarco avatar Feb 01 '19 23:02 martinellimarco

As a workaround, be sure to set the following into php.ini (values as example) :

session.gc_probability = 1
session.gc_divisor = 100
session.gc_maxlifetime = 604800

Sessions will then be cleaned randomly when PHP pages are reached by visitors.

And you can then also disable the useless sessionclean job (at least on Debian) :

systemctl disable phpsessionclean.timer
systemctl stop phpsessionclean.timer

benrubson avatar Feb 02 '19 17:02 benrubson

Thank you, that's exactly how I solved it.

martinellimarco avatar Feb 02 '19 19:02 martinellimarco