I’ve created on my fresh server a directory structure like this:
/home/$username/$domain/ (for example: /home/domaincom/domain.com/)
Everything works well, but unfortunatelly, apache (or PHP) is not purging tmp directory automaticly. :/
Is there a simple way to purge those directories? For example a solution like logrotate, where I set directory to rotate like this: / home / * / * / logs
Problem appeared because on user temp directory has 1562074 files. :/ I’m not sure who (apache, php, external script) should clean this directory and how often.
Apache or php is not obligated to clean unused temp files (mostly sess_…)?
Thanks for any answers. 🙂
You changed the default PHP session save path.
On a Debian system, the PHP directive
session.gc_probability is set to 0, preventing old sessions from being cleaned up, and a cron job is set up that clears out the old PHP sessions – but only from the default save path!
So you can fix this in one of two ways:
- Change the PHP session save path back to its default.
session.gc_probability = 1in
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.