php individual tmp sessions not deleted

Discussion in 'Installation/Configuration' started by asticot, Dec 11, 2009.

  1. asticot

    asticot New Member


    On my ISPCONFIG server (running on debian 5), I have a little problem with the automatic deletion of tmp files that are in /var/www/clients/clientX/webX/tmp/

    In the /etc/php5/apache2/php.ini file, I have :

    ; This is disabled in the Debian packages, due to the strict permissions
    ; on /var/lib/php5. Instead of setting this here, see the cronjob at
    ; /etc/cron.d/php5, which uses the session.gc_maxlifetime setting below.
    ; php scripts using their own session.save_path should make sure garbage
    ; collection is enabled by setting session.gc_probability
    ;session.gc_probability = 0
    session.gc_divisor = 100

    ; After this number of seconds, stored data will be seen as 'garbage' and
    ; cleaned up by the garbage collection process.
    session.gc_maxlifetime = 1440

    The cronjob /etc/cron.d/php5 runs every 30 minutes but it delete only tmp files that are in /var/lib/php5

    Since all my website have a apache directive :

    php_admin_value session.save_path /var/www/clients/client1/web1/tmp

    There are many location for tmp files. And so the problem is that all tmp files of each website are not deleted.

    Do you know what to do ?
    - Should I enabled "session.gc_probability = 1" in my php.ini ?
    - Should I remove the session.save_path for each website ?
    - Should I write a script to manually delete tmp files ?

  2. till

    till Super Moderator Staff Member ISPConfig Developer

    This is a problem in php. If a custom session tmp dir is defined, php will not care about removing sessions files anymore. The best way to solve this is to write a custom script. We will add such a script in ispconfig too to fix this php problem.
  3. asticot

    asticot New Member

    OK thank you Till,

    For information, here is what I am doing now manually :

    In each tmp dir :
    find -cmin +24 | xargs rm

    This command will delete all files that were not changed for 24 minutes.
  4. xaver

    xaver New Member


    i had this Problem twice.
    If i open a session and switch from mod_php to fastcgi + suexec the problem start because www-data is the old User and the new user is web??:client??.
    The user can't change the file anymore.

  5. gzx21

    gzx21 New Member


    I was wondering whether this problem was fixed. I am using ISPConfig version (Debian Wheezy, Apache) and it still seems to be an issue.

    Till, perhaps if the deletion script is not in the production, would you be so kind as to provide the script if you managed to write it?

    Thank you very much.
  6. asticot

    asticot New Member

    Yes I confirm this issue was fixed a long time ago.
  7. gzx21

    gzx21 New Member

    OK, so how is it possible that it's still happening in my installation? Is it possible that I might have misconfigured something? I closely followed the guides on HowtoForge, nothing really special.

    Is it possible that these log messages are related to the problem? They appear every 30 minutes in my local mail:

    Thank you.

Share This Page