WordPress Permissions OK – Update Failed WTH

I hope for your sake this works. I had searched high and low for a solution. If you are getting the all to common error Update failed: Unable to create temporary file. You have checked and rechecked your file/folder permissions. maybe even went so far as to assign the entire wp-content folder permissions of 777.

This problem started for me with one particular installation on Robin’s blog. Keep in mind I run 6 blogs of our own, and host just as many for customers. All from the same server.

Robin’s blog would not update, plug-ins and auto-update just would error immediately with the following message “Update Failed: Unable to create temporary file.” When WordPress downloads files it needs a temporary folder to store the compressed files and a place to work with files while it is in the upgrade process.

If WordPress cannot create the temporary files, which is typical when your uploads folder has the default permissions applied. Usual a chmod to 777 on the uploads folder fixes the issue. What if it does not?

If you are like me, and have moved your blog from another host (yet another reason to hate GoDaddy). You might just want to check your wp-config.php file for any lines that looks something like this…(your actual path may vary) The important part is the assignment of a value to the Constant  ‘WP_TEMP_DIR’

define(‘WP_TEMP_DIR’, ‘/var/www/vhosts/mysite.com/httpdocs/tmp’);

If you do see this, make certain that the folder exists and is writable. You can also delete this line totally. WordPress will take over and set up a folder for you if this line is missing.

In this case the ‘tmp’ folder referenced was outside of the wp-content folder. It was also completely missing.

This particular line should not be present if you installed WordPress yourself. We had this code as an artifact from a script installation of WordPress on a completely different host. I created the tmp folder in FileZilla assigned the appropriate permissions and auto update was fixed. Plug-ins were also updating as well as new plug-in installations. Problem solved. I deleted the line from the config file. Now WordPress works just like it should.

Hope this helps someone. Leave me a note if it does.