Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 21st May 2012, 14:26
Croydon Croydon is offline
ISPConfig Developer
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 932
Thanks: 16
Thanked 264 Times in 208 Posts
Lightbulb PHP Session Garbage Collection on debian


it has been a while since my last post

I came across a problem with php session files on debian some time ago. On debian the default config of PHP disables session garbage collection. This is because the default session path is not writeable by the webserver.
The default session path is cleaned up by a cron job.

I wrote a blog post about this (only german):

ISPConfig sets up a different session path for the webs - that is a good solution - but:
If the PHP software (script) running doesn't set the garbage collection the session files are never deleted. On a highly visited page this can be a problem.
The problem is even bigger if you store your session data inside a database or even worse when storing inside a MEMORY table.

As mentioned in the blog post i set
@ini_set('session.gc_probability', 1);
in all my scripts to re-enable garbage collection.

I would recommend that ispconfig sets this variable for all websites in the vhosts file just for the case that the default setting is "disabled" as it is on debian.

Last edited by Croydon; 21st May 2012 at 14:39.
Reply With Quote
Sponsored Links
Old 21st May 2012, 15:23
till till is offline
Super Moderator
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,652 Times in 4,461 Posts

ISPConfig is cleaning up the session directory automatically with a cronjob, similar to the system session directory. If you use different session storage systems, you shopuld take care about that of course.
Till Brehm
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Old 21st May 2012, 15:37
Croydon Croydon is offline
ISPConfig Developer
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 932
Thanks: 16
Thanked 264 Times in 208 Posts

It does? Even for each web?

I have > 35.000 session files in /var/www/clients/client1/web6/tmp/, most of them from the beginning of april.

Edit: I am sorry - it seems an update from 3.0.4 to current version did the trick Thought this one would be on current version already.

Last edited by Croydon; 21st May 2012 at 15:40.
Reply With Quote


debian, garbage collection, php, session

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiserver setup: repquota command not found. CSsab Installation/Configuration 2 27th January 2011 16:11
Problem with services!! banzaiwebstudio.com Installation/Configuration 7 19th May 2010 22:13
ISP Config hesitation when opening web pages frankb Installation/Configuration 7 15th December 2008 14:06
Question about Virtual Hosting With Proftpd And MySQL (Incl. Quota) On Debian Etch ikkem HOWTO-Related Questions 30 26th February 2008 20:38
Website users? ctroyp General 25 6th January 2006 19:02

All times are GMT +2. The time now is 13:38.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.