Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.