Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

After we upgraded to Wordpress 3.0.1 (from Wordpress MU 2.9.2) we began getting an error message whenever we tried to upload media.

"Missing a temporary folder"

Various articles around the web mention the php setting upload_tmp_dir needing to be set in php.ini. This is not actually a requirement. I know because it is not set in our test environment, and it was not set in our production environment before the deploy. In both cases uploads worked.

So what changed?

I have an answer, but I'm not sure it's the definitive answer. I'll post mine.

share|improve this question
add comment

1 Answer

upload_tmp_dir is an optional setting in php.ini. Php will attempt to use the system default temp directory. So it should just work.

If something happens to the permissions on your temp directory, regardless of wether you set it in php.ini or use the system default (usually /tmp on unix like systems), then media uploads will fail. You will see the same error "Missing a temporary folder" if folder doesn't exist, but also if you don't have proper permissions on the temporary directory.

Your web server, Apache or whatever, is probably running as nobody, or some other account with basically no rights to anything. So the first thing to check is that /tmp is globally writable.

On unix like systems it goes something like this. I'm assuming that your system default temp directory is /tmp. From the command line

$ ls -l /tmp
lrwxrwxrwx@ 1 root  admin  11 Sep 10 11:40 /tmp

The first bit lrwxrwxrwx should look just like that. No dashes. If not

$ chmod 777 /tmp

and if it gives you permissions errors

$ sudo chmod 777 /tmp

You'll need the root password.

share|improve this answer
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.