WordPress.org

Ready to get started?Download WordPress

Forums

Unable to create directory / Is its parent directory writable by the server? (30 posts)

  1. Tony Stark
    Member
    Posted 5 years ago #

    Hi All,

    OK, the 5 minute innstall issue is becoming a 3 day nightmare?! I can now upload files AOK after changing permissions but when I check the "Organize my uploads into month- and year-based folders" box it errors with the following error:

    "Unable to create directory /var/www/vhosts/[mydomain]/httpdocs/wp-content/uploads/2009/03. Is its parent directory writable by the server?"

    What is up with that? It is clear that WP/Apache/PHP can write to the root of wp-content/uploads but when it goes any deeper it fails?!

    If I uncheck the value it works? FYIW, I am using Plesk 8.6 / Debian.

    Anyone?

    Thanks

    Tony

  2. s_ha_dum
    Member
    Posted 5 years ago #

    Try this: WordPress Troubleshooting: Permissions, CHMOD and paths, OH MY!.

    I really dislike that permissions have to be set as high as they do.

  3. dominoeffect
    Member
    Posted 5 years ago #

    This is really easy

    Using your FTP software, change the permissions setting for the 'uploads' folder, and all subsequent directories beneath it, to 777.

    In Filezilla for example you simply right-click the folder 'uploads', type in '777', and check the box which says 'Recurse into subdirectories'.

    This allows WordPress to write not just to the 'uploads' folder, but to create folders like '2009', '03', '04', etc., and write to them too.

  4. Samuel B
    moderator
    Posted 5 years ago #

    The point is you should only have to do that once. Then you should be able to go back to 755 chmod as 777 is insecure.
    Maybe talk to your host about this as most servers do not require this behavior.

  5. dominoeffect
    Member
    Posted 5 years ago #

    Ah ok, I really can't help then. Sorry.

  6. nabtron
    Member
    Posted 5 years ago #

    this is caused by the wrong path in settings for "store uploads to this directory"

    [link moderated, please place pertinent information in Codex]

  7. rodrigomouras
    Member
    Posted 4 years ago #

    Nabtron, Thanks a lot!

  8. Sunite
    Member
    Posted 4 years ago #

    Thanks

    [link moderated, please place pertinent information in Codex]

  9. sergee
    Member
    Posted 4 years ago #

    If you tryed everything and upload in your wordpress still doesn't work - i have an answer for you. In short: php safe mode won't let you create files or directories if your php scripts and upload directory belongs to different users. So there are 2 possible solutions: either disable php safemode (not recommended), or change an owner of scripts and upload directory:

    cd blog_root
    chown -R apache:apache *

    [link moderated, please place pertinent information in Codex]

  10. blinka81
    Member
    Posted 4 years ago #

    I was having similar problems. Setting the permissions on the uploads directory to 777 did indeed solve the problem, but this was not a security hole I was willing to overlook. I did do some testing with 777, however, before switching back to 755, and found that the "nobody" user was actually responsible for moving the pictures into the directory. Since the nobody account doesn't have write permission (unless the directory is set to 777) wordpress was complaining.

    To see if this is your issue, switch the folder to 777, and upload a picture. Then check to see who is the owner of that picture. If it is "nobody" then you are having a similar issue here.

    There are two solutions.

    If you have (root) access to the command chown -- you can use that command (see sergee's post above) to change the owner of that directory to "nobody".

    Alternatively, if you do not have access (I didn't), then you need to email your system administrator and have them help you (they actually switched me over to suPHP which allows my user account to run all the necessary scripts instead of "nobody").

    I think this is certainly a more responsible action than just setting a public folder to 777.

  11. littleREDelf
    Member
    Posted 4 years ago #

    @Nabtron: simple & easy fix - last week our website blew up and changed servers, re-writing the name of the dir the blog and uploads were in.

    i went into Miscellaneous Settings as instructed and changed the dir back to "wp-content/uploads" and all was restored!

    thank you!

  12. nabtron
    Member
    Posted 4 years ago #

    i am glad that it helped you! :)

  13. TRLocke
    Member
    Posted 4 years ago #

    Okay, this is all I needed to fix this:

    hello tan,

    please make sure it is “wp-content/uploads” and not “/wp-content/uploads”

    waiting to know if it was still not solved.

    My default had the slash in front. Amazing. I didn't need to change permissions or anything.

    Thank you,
    TRL

  14. niko82
    Member
    Posted 4 years ago #

    Thanks all, this was a very helpful thread. This seems like a common problem.

    I had ported my site from a build on the local host in xampp to it's current location. And in the path settings for store uploads I had left "C:\" in front of "wp-content/uploads"

    I was fussing around for about 30 mins trying to figure this out, annoying.

    Don't make the same mistake twice, eh?

    BTW someone should mark this topic as resolved, very helpful when searching.

    n.

  15. jesseluna
    Member
    Posted 4 years ago #

    I had this problem when my Web host "upgraded" my account. I followed Nabtron's advice, and noticed that the Miscellaneous Settings had the "store uploads to this directory" with a full path instead of just "wp-content/uploads." I only left "wp-content/uploads" in that field and saved the changes and that fixed the upload problem! Settings> Miscellaneous from the Dashboard and make the change. Thx Nabtron!

  16. dublinedanto
    Member
    Posted 4 years ago #

    I'm having this problem and I've checked the wp-content/uploads setting and it seems correct... is there anything else at play here?

    thanks

  17. ThePromotionAdvisor
    Member
    Posted 4 years ago #

    @nabtron Your advice saved me a headache. I was very uncomfortable changing the permissions-even if only for a short while-because my blogs have been hacked before.

  18. lswink
    Member
    Posted 4 years ago #

    I have the same problem when trying to upload an image from my own files. This message appears every time: Unable to create directory wp-content/uploads/2009/12. Is its parent directory writable by the server?
    I read your suggestions and tried everything to no avail.
    I have changed the miscellaneous settings into every possible configuration:
    wp-content/uploads
    wp-content/uploads/
    /wp-content/uploads
    /wp-content/uploads/
    I have unchecked the organize by month box as suggested.
    I have filled in the Full URL path to files.
    I talked to the hosting company and was told that the permissions are set correctly.
    Any other suggestions?

  19. kegill
    Member
    Posted 4 years ago #

    Check your .htaccess file.

    See this thread for what the file should contain. It should live at WordPress root unless you have changed the blog homepage to be different from the directory where you installed WordPress ... then it should be at your account root.

    http://wordpress.org/support/topic/257400?replies=3

  20. rhusari
    Member
    Posted 4 years ago #

    After fiddling a bit with the permissions, I tried miscellaneous in settings and it was indeed the wrong path (due to changing servers and re-uploading on new server). wp-content/uploads did the trick. Thanks to all! Very useful thread indeed.

  21. mmmm1982
    Member
    Posted 4 years ago #

    in my case I had to change the owner of the entire WordPress folder to www-data . I'm not sure where this user came from and why, but here's the command I used
    sudo chown -R www-data:www-data /var/www/wordpress

  22. chengdu living
    Member
    Posted 4 years ago #

    Thanks to TRLocke, who posted the solution that worked for me.

    Okay, this is all I needed to fix this:

    hello tan,

    please make sure it is “wp-content/uploads” and not “/wp-content/uploads”

  23. shockwavelouie
    Member
    Posted 4 years ago #

    Can't upload any photo on my blog site.

    Unable to create directory /home/mysite/public_html/blog/wp-content/uploads/2010/02. Is its parent directory writable by the server?

    I have tried the wp-content/upload thing but it didn't work, I checked /wp-content on my ftp browser but I haven't seen any upload folder. I've tried uploading photos thru media but it says the same thing.

    What could possibly be wrong?

  24. Ria_Amp
    Member
    Posted 4 years ago #

    Shockwavelouie - looks like you might need to create the upload folder. I had to.

    Hint from chengdu living about eliminating the forward slash before the "wp-contents"' is what made it work for me.

    Thank you so much!

  25. doups3
    Member
    Posted 4 years ago #

    Okay so I tried changing the directory

    wp-contents/uploads and that did not work.

    After playing around for like an hour I finally unclicked "Organize my uploads into month- and year-based folders". That did it.

    Who says wordpress is a time saver eh? hehe

    Thanks for everyone's help.

  26. WPContent.com
    Member
    Posted 4 years ago #

    I posted a video tutorial which covers how to change your permissions so that you can upload media. http://www.wpcontent.com/post/183

  27. rribeiro
    Member
    Posted 4 years ago #

    Unfortunately none of the solutions above have worked!

    I was first getting this: Unable to create directory /wp-content/uploads. Is its parent directory writable by the server?

    Then I changed everything to 777 permission and uploading the file told me that the file couldn't be moved to the uploads folder. Help?!

    I'm using Filezilla btw.

  28. batrachoid
    Member
    Posted 4 years ago #

    Check here.

  29. Rynoa
    Member
    Posted 4 years ago #

    Hi, I have the same problems and I have already tried everything suggested in this topic but nothing worked so far.
    I noticed that my error message says:

    Unable to create directory
    D:\Inetpub\webs\mydomaincom/wp-content/uploads.

    without the dot between mydomain & com...
    if this is the problem, how can I solve it?

  30. joelbrock
    Member
    Posted 4 years ago #

    In settings > Misc. resetting the upload dir to the default

    wp-content/uploads

    worked for me!

    ThnQ

Topic Closed

This topic has been closed to new replies.

About this Topic