large number of files in /var/cpanel/php/sessions/php56

tidew

Registered
Feb 27, 2019
3
0
1
Brazil
cPanel Access Level
Root Administrator
Hi good day to all,

On my WHM/Cpanel server , in the folder /var/cpanel/php/sessions/php56, are a large number of files that looks to be having no purpuse.. Any one knows if i can delte them or what they serve?

Thanks in advance
 
Last edited by a moderator:

GOT

Get Proactive!
PartnerNOC
Apr 8, 2003
1,542
207
343
Chesapeake, VA
cPanel Access Level
DataCenter Provider
Figured they would be session files. You might just want to remove the ones that are over three days old. And you may want to look into why that site is creating so many of them. You can tell what site they are from by looking at the user who owns them.
 
  • Like
Reactions: tidew

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,234
363
cPanel Access Level
DataCenter Provider
Twitter
Hello @tidew,

Here's a description of the directory you referenced:

The system saves PHP sessions in the /var/cpanel/php/sessions directory by default. EasyApache 4 installations create subdirectories based on the version of PHP that exists on the server. If multiple versions of PHP exist on the system, a subdirectory exists for each version of PHP. The root user owns each directory, and each directory possesses 1733 permissions. This allows PHP to write session files, but users will not possess permissions to delete those sessions in the directory.
Can you check if the /usr/local/cpanel/scripts/clean_user_php_sessions script is cleaning up the older session files? We document how to use this script on the link below:

The clean_user_php_sessions Script - Version 78 Documentation - cPanel Documentation

Let me know if you notice any errors or if the script doesn't clean the old session files (it's setup to run daily as a root cron job, so it should be removing the old session files).

Thank you.