One of my Debian machine's inodes recently filled, and the culprit turned out to be /var/lib/php5/sessions
, which had accumulated 2.5 million temporary session files, though it's supposed to be cleaned up whenever files are more than 24 minutes old.
Debian steps on PHP's native garbage collection, and instead uses a program called /usr/lib/php5/sessionclean
to do this work. My version is dated Feb 8, which should be the newest version on Debian Jessie. It was exiting quietly, but as far as I can tell, doing nothing.
I was looking through the code and found this line:
session_config=$(PHP_INI_SCAN_DIR=/etc/php5/${conf_dir}/conf.d/ php5 -c /etc/php5/${conf_dir}/php.ini -d "error_reporting='~E_ALL'" -r 'foreach(ini_get_all("session") as $k => $v) echo "$k=".$v["local_value"]."\n";')
That seems to be consistent across multiple machines all running the newest Jessie.
As far as I can tell that doesn't work and would never work because it tries to run /etc/php5/apache2/conf.d/ php5
instead of /etc/php5/apache2/conf.d/php5
. But even putting that back together, I kept getting errors, this time about the '-c' option.
Any ideas about how to make this work right and why the out-of-the-box debian is failing?