Title: Image upload problem
Last modified: August 19, 2016

---

# Image upload problem

 *  [nepalcatmandu](https://wordpress.org/support/users/nepalcatmandu/)
 * (@nepalcatmandu)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/image-upload-problem-17/)
 * I have problem uploading the image on my blog.
 * When I upload it shows the error like
 * Unable to create directory /var/www/vhosts/nepal-kathmandu.com/httpdocs/blog/
   wp-content/uploads/2010/04. Is its parent directory writable by the server?
 * Any help ?

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [Safirul Alredha](https://wordpress.org/support/users/zeo/)
 * (@zeo)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/image-upload-problem-17/#post-1478050)
 * see: [http://codex.wordpress.org/Changing_File_Permissions](http://codex.wordpress.org/Changing_File_Permissions)
 * Set permission to writable e.g 755 for `/wp-content/`
 *  [Shane G.](https://wordpress.org/support/users/shane-g-1/)
 * (@shane-g-1)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/image-upload-problem-17/#post-1478052)
 * Hi,
 * Assign 755 recursive permissions to wp-content directory with the help of your
   web hosting service provider which will resolve the issue.
 * Do not assign 777 permissions which may lead to hacking problem.
 * Thanks,
 * Shane G.
 *  Thread Starter [nepalcatmandu](https://wordpress.org/support/users/nepalcatmandu/)
 * (@nepalcatmandu)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/image-upload-problem-17/#post-1478055)
 * Thank you so much for the reply but as I checked the wp-content, it has already
   the permission 755. But still there is problem.
 * Any suggestions? Thanks.
 *  Thread Starter [nepalcatmandu](https://wordpress.org/support/users/nepalcatmandu/)
 * (@nepalcatmandu)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/image-upload-problem-17/#post-1478061)
 * It worked when I changed the permissions to 777. Is there any problem with it?
   It didn’t work for permission 755 for wp-content. Any suggestion is appreciated.
 *  [Safirul Alredha](https://wordpress.org/support/users/zeo/)
 * (@zeo)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/image-upload-problem-17/#post-1478062)
 * There’s now `/uploads/` folder inside `/wp-content/` rite? Switch back to 755
   for both `/uploads/` and `/wp-content/`. See whether now u can upload an image.
   If not just stick with 777.
 *  [fauxfire76](https://wordpress.org/support/users/fauxfire76/)
 * (@fauxfire76)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/image-upload-problem-17/#post-1478432)
 * I’m having the same issue however changing the permissions regressively to 777
   does not fix the problem. Neither does setting it to 755. Any ideas as to what
   else it could be?
 *  [2ells](https://wordpress.org/support/users/2ells/)
 * (@2ells)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/image-upload-problem-17/#post-1478439)
 * I’ve encountered the …
 * “Unable to create directory /……/wp-content/uploads/2011/01. Is its parent directory
   writable by the server?”
 * … problem today and have been looking through the many posts on the subject.
 * Different ‘fixes’ seem to sort this out for different people but I’ve got to 
   the bottom of why it was happening on my environment. As I haven’t found any 
   posts that descibe the solution that worked best for my specific circumstances
   I thought I’d post it up here in case it helps any others.
 * I should point out that I’m just playing around with workpress at the moment 
   and ‘my environment’ is a webserver i’ve set up on my home network (Unbuntu/apache)
   and installed wordpress onto … so it’s not a ‘live’ wordpress installation on
   a hosting site so my experiences may only be of use to anyone playing about with
   a similar set up.
 * Anyway to get to the point … the error message above is caused (on my system)
   by the fact the /uploads directory and its sub-directories and files are being
   created by the user on Unbuntu which runs apache ie a user named ‘www-data’. 
   Now as I’ve installed wordpress as a user called ‘phil’, all the directories/
   files in the wordpress file structure are owned by user ‘phil’ and group ‘phil’.
   Permission on these are set to 755 so when wordpress tries to create the upload
   folder using the apache user ‘www-data’ it does not have permission to create
   the directory and hence the error message.
 * The work-around I’ve seen mentioned in most posts (and on the codex at [http://codex.wordpress.org/Using_Image_and_File_Attachments](http://codex.wordpress.org/Using_Image_and_File_Attachments))
   is to change permssion on the wp-content directory to 777. This gives all users(
   including ‘www-data’) permission to create a directory so the directories and
   files can be created successfully. The permission must then be changed back to
   755 as leaving permission at 777 is not desirable for security. As the upload
   folder is now owned by ‘www-data’ there should be no problems with ‘www-data’
   creating further sub-folders ie for years and months.
 * Another solution (this is the one I’ve not seen posted elsewhere) is to resolve
   the problem of the conflict of one user installing wordpress and another user
   running it via apache.
 * This can be done as follows :
 * edit the file /etc/apache2/envvars
 * locate lines:
 * export APACHE_RUN_USER = www-data
    export APACHE_RUN_GROUP= www-data
 * and modify to the user who installed wordpress (in my case ‘phil’)
 * export APACHE_RUN_USER = phil
    export APACHE_RUN_GROUP= phil
 * Save the file and then restart apache.
 * Now when you upload the media files the upload directories are files have user/
   group the same as the rest of the workpress file structure.
 * Like I said this may be of limited use to anyone having this problem on a hosting
   site as you’ll not be able to change the apache user but if you have your own
   dev environment it may save you a couple of hours of messing about!
 *  [fauxfire76](https://wordpress.org/support/users/fauxfire76/)
 * (@fauxfire76)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/image-upload-problem-17/#post-1478440)
 * Actually I had meant to respond to this but kept forgetting. It turned out that
   it was simply my hosting company had changed some settings which rendered the
   original path void. I just had to go into the wordpress settings and change the
   upload path and it worked fine.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Image upload problem’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 8 replies
 * 5 participants
 * Last reply from: [fauxfire76](https://wordpress.org/support/users/fauxfire76/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/image-upload-problem-17/#post-1478440)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
