Overview
The /tmp directory stores temporary files on the web server — on Shared Hosting it is shared among all customers and cleared on restart, so if it fills up, programs can fail (for example, uploads). You can create your own /tmp directory to control this. This article explains what /tmp is and how to create a personal one.
What is the /tmp directory?
Web servers have a directory named /tmp used to store temporary files. Many programs use this directory to write temporary data and generally remove it when it is no longer needed. Otherwise, the /tmp directory is cleared when the server restarts.
On Shared Hosting servers, the /tmp directory is shared among all customers on the server. When it becomes full, some programs stop working. For example, it is no longer possible to upload a file to a site since there is no room in the /tmp folder to store the temporary file while it's uploading.
How do I create a personal /tmp directory?
You can configure your software to use any directory you want to maintain control of temporary file storage. For example, if your site is using PHP, adjust the upload_tmp_dir directive.
Where to create this directory?
It's recommended you create this directory in your user's home directory (outside the web-accessible directory). For example:
/home/username/tmp