Question

Today there were some problems with my site: php file uploads weren't handling properly, and none of the passenger-wsgi python scripts were executing. I contacted my webhost, and they said that the server's tmp directory had reached a "disk space shortage" and that they fixed the problem.

The same thing started happening a couple minutes later, to which they replied similarly that the problem is now fixed.

I haven't had a problem since, but I'm quite worried this is going to be an ongoing thing. They sent me:

We unfortunately cannot guarantee that the issue will happen again because a new user may abuse /tmp but we do usually resolve these issues within 10 or 15 minutes of them being detected from our monitoring system.

I'm on shared hosting, so this isn't completely unexpected, but it's still rather unsettling. Is there anything I can do in this case? Is there any way I can at least know when it's going to happen - perhaps checking the used space in tmp along with the total allowed space with PHP?

This isn't the first problem I've had with them, and I've only used them for about 2 weeks now, so I'm considering the 45 money back guarantee and finding another host. I haven't, however, been to find a good php/python host that either supports M2Crypto and other Python modules I use or would allow me to install them myself. Should I stick with them or jump ship and find another web host?

Was it helpful?

Solution

Easy one : if you host allows this, get your PHP scripts to use upload_tmp_dir a custom tmp directory for uploads.

That way, it will depend on up your hosting space only !

OTHER TIPS

PHP have the disk_free_space function which you can use to monitor /tmp. This should, however, not be needed . It's the hosts responsibility to solve this once and for all.

I have myself worked as a system administrator on a shared web hosting company and I know that a solution to these types of issues are vital. A full temp directory will effectively shut out almost all websites on the server so it should be in their best interest to find a solution, otherwise the customers will leave. You should ask them them what plans they have to resolve this issue. If you get a stupid know-nothing answer, demand that the issue gets escalated to a technician so you can talk (or e-mail) with someone in charge. Don't let them put this issue aside, but demand a long-term solution, otherwise it will happen again.

If you are unable to find shared hosting up to your needs, try a dedicated virtual hosting (VPS) instead. The downside to that is that you must be your own sysadmin, but at least you get what you need in terms of software.

You could try to set upload_tmp_dir and whatnot to places inside of your personal area instead of the global /tmp. This would, however, require access to a php.ini file. Access that you probably don't have. Also, if you don't have access to anything above the webroot, you shouldn't do this (and you should promptly leave the host -- putting things above the webroot is essential).

In short, if this problem persists, I would leave the host. There's not much you can do about it other than take your business else where.

I avoid shared hosting for situations like this. You can get stable, well resourced VPSs for fairly cheap these days (though that of course brings it's own set of problems, especially if you're hosting a small number of sites).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top