How to avoid Unknown: write failed: No space left on device (28)

Mathias Bak picture Mathias Bak · Sep 2, 2011 · Viewed 7.3k times · Source

I am on a shared host and i get this error on my domain

Unknown: write failed: No space left on device (28)

I think its because my /tmp directory is full, but i can't be sure. If that is the case can anyone help me why this is happening? It is the second time this happens and I have to take my site off the web when it does, which is not good...

I don't know if it is related, but I handle a lot of images and convert them in PHP. I save them temporary using the tempnam() function. Is this causing the error?

Do anyone have any idea? Please I really need to fix this fast :( Thank you.

Answer

Pekka picture Pekka · Sep 2, 2011

This can have two reasons:

  • Your web hosting account has a quota set, which you have exceeded. Solution: Free up some space. (You should have some sort of control panel that can give you an indication whether this is the case.)

  • The web server your site runs on has run out of space. You need to talk to your hosting provider. They need to make sure this doesn't happen again.