Image Upload Problems with WordPress?

Here’s the fix if your WordPress version 2.6 or 2.7 is failing on image uploads with

The uploaded file could not be moved to /var/www/vhosts/

Before you read further, please note A) these instructions are for *nix servers (typically Linux), not Windows servers, so ask your host which you have if you don’t know, B) you’ll need to ssh into your server and run command line commands, and C) I have the very macho root access to my Linux/Apache server, so I can run chown commands. Most hosts will disallow you root access, and you’ll simply have to ask your tech support to do this. That shouldn’t be a problem.

Having said that, you want the ownership and permissions to look like this for these three important directories:

wp-content drwxr-xr-x (755)  user group
uploads drwxr-xr-x (755)  apache apache
themes drwxr-xr-x (755) user group

and PHP safe_mode is OFF

Please note my user user of group group will differ from yours. Typically, the user will be whatever your FTP login is. In other words, don’t use “user”, “group” or even “apache”. Change these to fit your environment.

If all this blows your mind up, just point your hosting’s tech support to this blog post and say “I want that”.

Tags: , , , , ,

4 Responses to “Image Upload Problems with WordPress?”

  1. SarahD Says:
    May 5th, 2009 at 8:35 pm

    Good, concise post. Thanks. One note though, changing the owner and group to “apache” on the uploads directory only works if your Apache server is running as “apache”. My Apache server is running as “nobody”, so I needed to change user and group to “nobody” to make this fix work.

  2. Check Pagerank Says:
    June 8th, 2009 at 12:06 pm

    I strongly recommend that you turn the No Follow off in your comment section. I’ll watch Google Webmaster Tools, and if the links don’t show up after a couple of weeks — I won’t go back to that blog again. Another suggestion: you should have a Top Commentator widget installed. Do Follow and Top Commentator will ensure that you have a successful blog with lots of readers!

  3. khurram Says:
    August 28th, 2009 at 6:41 pm

    I have same problem read many posts but all suggest to do 777 permissions which obviously is not a good workaround. Your apache apache makes sense, I have also checked my server running as nobody(99) nobody, will this really help to make user to nobody?

    Secondly if change the user to these settings will I need to recursively apply settings to sub-folders?

  4. Matt Says:
    August 29th, 2009 at 9:02 pm


    Yes, chown the directory to nobody(99):nobody if that is indeed your web server’s user and group. You do not have to do a recursive ownership change.

Leave a Reply