skip to Main Content

Can I safely delete the sessions in cagefs/var/cpanel/php/sessions/ea-phpxx (xx being the version) in cpanel?

I have over 1 gb of space occupied with them and they are 3-4 months old.

3

Answers


  1. Chosen as BEST ANSWER

    It seems that these sessions files can be removed (at least I tried for php 7.0 via ftp and did not receive any notification/warning about it).

    The problem with the 5.4 was that the folder was deleted and recreated...

    like in this link folder "ea-php55" deleted, now session doesn't work

    I resolved that by setting the session path to /var/cpanel/php/sessions/ea-php55 instead of /var/cpanel/php/sessions/ea-php54 and using still php 5.4


  2. You can add this command end of session.pm on this directory ‘/usr/local/cpanel/Cpanel/config/session.pm’

    package Cpanel::Config::Session; 
    our $SESSION_EXPIRE_TIME = ( 60 * 60 * 24);
    

    Clear all sission older 24 horse

    This command clear all session in to
    ‘/usr/local/cpanel/Cpanel/Session/* ‘

    REF

    Login or Signup to reply.
  3. I had the same problem (with inodes saturation) and deleted the files without problems.

    According to the suggestion by the Administrator of the cPanel forum referenced by @Hamed, I made a small script to be used in a cronjob. Hope this can help others (use with care at your own risk):

    #!/bin/bash
    
    session_dir="/var/cpanel/php/sessions"
    
    touch --date "$(date -d '30 days ago' +'%Y-%m-%d %H:%M:%S')" $session_dir/older_than_this
    
    find $session_dir -type f -not -newer $session_dir/older_than_this -delete
    

    In this case the script deletes all session files older than 30 days.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search