Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My Symfony website has just started to show the following error:

ErrorException: Warning: session_start(): open (/tmp/sess_4h4kjh4ui4h478h48h44g02,O_RDWR) failed:No space left on device(28) in /var/www/website/symfony/src/symfony/component/HttpFoundation/SessionStorage/NativeSessionStorage.php line 87

I believe this is because the servers /tmp directory is on another partition which is full. What is the best thing to do in this situation? My server never gets rebooted so is there a manual way to delete these files? Or perhaps there is a way to increase its partition size?

Will removing these tmp files stop my website from working?

share|improve this question
    
Duplicate over at Server Fault. – Bobby May 13 '13 at 12:06

The following command should delete any file in /tmp, name of which is starting with "sess_", created or modified longer than 7 days ago. Any session state file persisting longer than 7 days, is quite unusual in my opinion and deletion of it should not cause any problems. But you should be the judge of how many days worth of those files you want to keep, by changing 7 to some other number in the command:

find /tmp -name "sess_*" -mtime +7 | xargs rm

share|improve this answer
    
I would also recommend moving the session files into a virtual host specific directory and setting up a cronjob to delete them if this is a production server. – Janoszen May 15 '13 at 7:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .