Forums

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

  1. Tony Stark
    Member
    Posted 8 months 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. apljdi
    Member
    Posted 8 months 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 8 months 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. samboll
    moderator
    Posted 8 months 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 8 months ago #

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

  6. nabtron
    Member
    Posted 4 months ago #

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

    details here: http://tech.nabtron.com/wordpress-2-8-file-image-upload-error-fix/34/

  7. rodrigomouras
    Member
    Posted 4 months ago #

    Nabtron, Thanks a lot!

  8. Sunite
    Member
    Posted 3 months ago #

  9. sergee
    Member
    Posted 2 months 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 *

    Complete description available here: http://tamkovich.com/2009/09/unable-to-create-directory-wp-content-uploads-is-its-parent-directory-writable-by-the-server/ (in Russian)

  10. blinka81
    Member
    Posted 2 months 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 2 months 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 2 months ago #

    i am glad that it helped you! :)

  13. TRLocke
    Member
    Posted 2 months 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 3 weeks 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 1 week 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 1 day 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

Reply

You must log in to post.

About this Topic