Jun 16/15
Chris Mebs Back to Blog

PHP Sessions not being deleted on Ubuntu Server

I came across an issue on one of our Ubuntu 10.04 servers where there was over 1GB of session files, and none getting deleted. I didn't know that Ubuntu ignores the normal PHP method for deletion in favour of using cron.

I won't re-write the whole shebang here, but here is the article that shed some light on the situation for me:


Here's what I did:

1. Make a backup: 

cp /usr/lib/php5/maxlifetime /usr/lib/php5/maxlifetime.bak

2. Edit maxlifetime file

nano /usr/lib/php5/maxlifetime

3. I deleted everything and pasted this:

#!/bin/sh -e



exit 0

About Box Clever

Box Clever is an Edmonton web design company focused on long lasting relationships and innovative website design and development.

Leave A Comment