gplessis / dotdeb-php

Dotdeb : PHP packages
https://www.dotdeb.org/
Other
125 stars 23 forks source link

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

Open merlyel opened 8 years ago

merlyel commented 8 years ago

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

benrubson commented 6 years ago

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 👍

martinellimarco commented 5 years ago

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

benrubson commented 5 years ago

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
martinellimarco commented 5 years ago

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