How do I set the upload_tmp_dir?
Overview
The temporary directory is used for storing files when a file is uploaded. This directory must be writable by whichever user PHP is running as. If not specified, PHP will use the system's default.
If the directory specified is not writable, PHP falls back to the system default temporary directory. If open_basedir is on, then the system default directory must be allowed for an upload to succeed.
READ ME FIRST
This article is provided as a courtesy. Installing, configuring, and troubleshooting third-party applications is outside the scope of support provided by (mt) Media Temple. Please take a moment to review the Statement of Support.
Symptom
I'm getting an upload_tmp_dir error when using PHP. How do I fix this error?
You receive an upload_tmp_dir error when you upload files through PHP.
Solution
This can be done by adding the following line in your php.ini file:
upload_tmp_dir /tmp
Alternatively, if you wish to specify upload_tmp_dir for just one domain, add the following line in the domain's vhost.conf file.
<Directory /path/to/vhosts/example.com/httpdocs>
php_admin_value upload_tmp_dir /tmp
</Directory>
Once the changes have been made to the file, run the command below to make the changes take affect:
websrvmng -a -v