WordPress.org

Ready to get started?Download WordPress

Forums

Unable to create directory - Is its parent directory writable by the server? (85 posts)

  1. davcarst
    Member
    Posted 6 years ago #

    Hey guys,
    I'm having issues uploading images to to a post. I keep getting the following error:

    Unable to create directory /var/www/vhosts/domain.com/httpdocs/wp-content/uploads/2008/05. Is its parent directory writable by the server?

    /wp-content/ and /uploads/ are both CHMOD'ed to 777.

  2. davcarst
    Member
    Posted 6 years ago #

    Bump.

  3. WPspider
    Member
    Posted 6 years ago #

    Having the same problem, I searched Google for this:

    "Is its parent directory writable by the server?"

    I then found a link to this:

    http://wordpress.org/support/topic/117888

    Which essentially says that people having the same problem shouldn't be so lame and they should go here:

    http://wordpress.org/search/Is+its+parent+directory+writable+by+the+server%3F?forums=1

    Of course, your post - asking the same question over again - comes up first in the results.

    Clearly a lot of resources are being wasted, both in looking for the solution and in scolding those looking as being unwilling to really look for the solution. So I guess the next question becomes, "Is there some way to make a 'sticky' article appear at the top of the results when someone actually makes a proper search?"

    Otherwise, it kind of seems like some old school geek penalty that is being imposed on everyone unfamiliar with the intricacies of UNIX. While I know that type of attitude is warranted in many cases, I'm not sure it is appropriate in the forums for a program that has such well-known and specific problems.

    In any event, I must go now, as I need to wander aimlessly through the 133 articles that come up for the error we are discussing.

    Best of luck.

  4. pinoyconsole
    Member
    Posted 6 years ago #

    Same problem as mine since upgrading to WP 2.5 and you're right WPspider, I also been in this post over and over again, top in the google search. I only hoping that one day a smart guy from wp.org will answer this question technically, not just a no brainer solution of CHMOD, everybody knows that before they come here. I dont know its been a long time now, still no solution. Anyone? please any solution?

  5. stevenewport
    Member
    Posted 6 years ago #

    Alright, I am no "smart guy from wp.org" but I was able to figure it out. I cannot give a universal step-by-step solution, but this is what worked for me. I am using Cyberduck for mac, but I'd assume it would be relatively universal with most FTP apps. The folder that WordPress writes to to store the images you want to upload is the 'uploads' folder (wordpress-root/wp-content/uploads/), this folder needs a permission assigned to it to give wordpress the ability to write to it (as you don't want just anyone to be able to go onto your server and load it with a bunch of files), so you give this folder (and only this folder) a '777 permission.'

    To do this I manually created the 'uploads' folder under wp-content, right-clicked>info (command+i for mac) for that folder and checked the boxes that allowed 'Groups' and 'Others' to write to this folder which it displayed as then having a 'rwxrwxrwx(777)' permission (I did this all through my FTP client). Once you click apply you shouldn't have any problems uploading media through wordpress.

    Hope this helps. This is the WP article I referenced

  6. Matt
    Member
    Posted 6 years ago #

    Tried the 777 on 'uploads', no dice. I'm thinking it's more than just a permissions issue for some including me... that's it's an ownership thing.

    Background: the WP files you upload are owned by your FTP user (whatever your login is when you fire up FTP). But the uploaded files are owned -- typically -- by the server.

    In my case the owner is 'apache'.

    Unable to create directory /var/www/vhosts/domain.com/httpdocs/wp/wp-content/uploads/2008/05. Is its parent directory writable by the server?

    So when I get that, should I change the ownership of var, recursively, to 'apache'?

    ~ ~ ~

    Changing Settings -> Misc -> Store uploads in this folder seems to have no effect.

    PLEASE no lectures on 777 permissions. I'm just trying to get this to work first. It's just removing a variable.

    Why wasn't this ownership thing a problem in WP versions < 2.5? I don't know.

  7. robhav
    Member
    Posted 6 years ago #

    Same problem here. What is happening is WordPress is trying to put the attachment or file into the uploads directory but the server doesn’t give it permission to do so. To fix this, I have also tried connecting via FTP and setting the permissions myself. I.e. CHMOD the /uploads/ folder to 777.

    However this doesn't work. Am now waiting to hear from the host to see if they have changed any settings. Previously, I have been able to upload files ok.

  8. pumpkinslayer
    Member
    Posted 6 years ago #

    I suspect mod security is causing this.

    Previously a directory would have to be owned by apache (user:nobody in my case) to allow uploads, which meant after the owner was changed by my host, I couldn't edit that stuff, but uploads via php worked. The common workaround (which I don't like) was to set the uploads dir to 777 to allow anyone to write to it, which was also enough permissions for apache to write to it (but also any old hacker, as happened to me before). With mod security, it appears that uploads are now all assigned to your personal user name and group, so normal permissions (755 for folders and 644 for files) should work fine.

    I have a WordPress MU install that stopped allowing uploads. The uploads dir previously needed the owner as "nobody" (apache) to do uploads.

    Another fresh install of WordPress 2.5 worked without changing owner and after uploading the uploaded files and newly created directories had my user as owner.

    So I suspect if you had the directory changed to user:nobody (apache) then you need them changed back to your personal user and group.

    Not a solution, but maybe a start.

  9. Matt
    Member
    Posted 6 years ago #

    pumpkinslayer, interesting thoughts. My problem would be that when a new month rolls around, and upon first file upload of that month, apache would attempt to create a new directory in uploads/2008/ directory (like 06/ for June), and that would be owned by apache.

    I could have everything upload simply to uploads/ to eliminate this variable. I've tried a full new clean WP upload, and the problem persists.

    All this is so confusing and frustrating because all these principles were working fine in WP 2.3 and earlier. Why is this so different? :-(

  10. pumpkinslayer
    Member
    Posted 6 years ago #

    Because my server now uses mod security, uploads are handled with my username and group, not Apache. Before it used to be handled with the Apache username and group.

    I'm currently getting my host to

    chmod -R username:usergroup wp-upload-dir

    to see if I can upload then.

    Note: I use php5, but I don't think that effects this (it might)

  11. pumpkinslayer
    Member
    Posted 6 years ago #

    These steps solved my uploading woes...

    Firstly, on my test install, file uploads wouldn't work and I got the "HTTP Error". This was fixed with the addition to the .htaccess (in the top level of your WordPress install).

    I added the first four lines below to my .htaccess, so this is what I ended up with.

    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    On my other install (WordPress MU, but same idea), files would crunch, but then the directories could not be created or the file could not be move to that location.

    This was because mod security is now installed. The uploads dir should no longer be given permissions 777, or given to user Apache. It should now be assigned to your username and group and folder permissions should be 755 and files 644 (that worked for me).

    This will change the usergroup and username, and your host might have to do it for you (because files owned by Apache are not editable by users).

    chmod -R yourusername:yourusergroup full/path/to/your/wordpress/upload/dir

    If you don't know the dir, just tell your host it's the "wp-content/uploads" folder (or "wp-content/blogs.dir" for wpmu).

  12. moshu
    Member
    Posted 6 years ago #

    Long thread for nothing.
    The error in the OP is clear: asking for the "parent directory". In this case the parent is wp-content. Make it writable (chmod 777) - problem solved.

  13. spamatiki
    Member
    Posted 6 years ago #

    How come, that using CHMOD 777 (which is known to be a vulnerability to any server!) should solve an image-upload problem ?!

    For me Image-Upload only works, when I turn off "arrange my uploads into month/year ..." and make the uploads folder chmod 777

    I have installed WordPress so many times over the last 3 years, and untill 2.5.x did not have problems with uploading images. Since 2.5, there are plenty, and I just refuse using CHMOD 777 for a solution.

    Please, there must be something else we can do about this.

    I find it hard to believe, that so many users are suddenly doing "something wrong", and that it's only their fault, that image-upload doesn't work seamlessly anymore ...

    My setup:
    OS: Linux
    PHP Version 5.2.0-8+etch10
    MySQL v5.0.32-Debian_7etch5-log
    Apache 2.0
    Module mod_secure not loaded
    HTTP Request: HTTP/1.1

    Browsing with:
    Intel Mac OS X 10_5_3
    3.1.1 Safari

    P.S. ... I have been looking through plenty of threads for the last 2 weeks to find a solution. I really don't post quickly, and don't complain about wordpress(!), I just don't know what to do. My earlier WP-installs work fine, as long as I don't upgrade to 2.5 ... and that kinda bugs me

  14. netman74501
    Member
    Posted 6 years ago #

    I am having sort of the same problem still... I don't see any error numbers and the old fashioned upload link is not anywhere to be found. I am new to WordPress. I get the IO Error with the message to try again later. I am using Firefox and have IE Tabs Extension for Firefox installed. When, and only when I have switched over to the IE Engine can I upload images. I have found that just accepting the security certificate in the IE Engine and then switching back to the Firefox Engine I can upload images, (using the Firefox Engine) until I restart Firefox. So, is this a problem with Firefox, WordPress, or my server?

    P.S.
    I have read through and tried all of the solutions posted here and none of them worked for me. Also, I do use the DNS service offered by dyndns.org because I have a dynamic IP if that is relevant.

    Thanks in advance...

  15. arminbw
    Member
    Posted 6 years ago #

    In my case turning php safe mode off helped. Check: http://wordpress.org/support/topic/180378

  16. adunate
    Member
    Posted 6 years ago #

    I didn't even have an uploads folder in my wp-content folder. I had to create on and then change permission to 777. I never realized I'd have to become a coder to write my blog.

  17. Meline
    Member
    Posted 6 years ago #

    I have turned php safe mode off. Didn't help.

    However, changing wp-content directory permission to 777 helped.

    But!

    Changing the permission to 777 is not an answer. Moshu, you have replied in many threads to change wp-content directory to permission to 777, but how come that would solve anything?

    There are several threads about this problem. It's unbelievable that no one has come up with a good solution :(

  18. Groovymarlin
    Member
    Posted 6 years ago #

    Thanks so much to pumpkinslayer. Adding the following to the top of my .htaccess file solved the image upload problem for me:

    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>

    Never had any problem with images before upgrading to 2.5.1, but as of that version image uploads would not work at all (and my host won't even let me change permissions to 777 on a directory; that's no answer). Apparently it's this mod security stuff that causes the problems.

  19. Romik84
    Member
    Posted 6 years ago #

    Go to General Settings and in WordPress address URL field leave: http://yoursite.com. This one is wrong: http://www.yoursite.com.
    Forget about CHMOD and SafeMode bullshits. It's a WP bug.

    bow...

  20. Meline
    Member
    Posted 6 years ago #

    No, Romik84, this problem isn't connected to sub-domains in any way :(

  21. Romik84
    Member
    Posted 6 years ago #

    No, Romik84, this problem isn't connected to sub-domains in any way :(

    For me it was the problem. I have 2 sites and on one it worked and on the second it didn't. So I compared the settings. And when I removed the "www" in the second one it started working...And it also wrote when I've tried to upload: Unable to create directory .../wp-content/uploads/2008/05
    now it works. I have changed both URLs: WordPress address (URL) as well as Blog address (URL)

  22. Liz
    Member
    Posted 6 years ago #

    Does anyone use 1and1.co.uk for their hosting? I don't have this problem with my hosting at 1and1.com. It's very odd. I've tried everything on this page and nothing has worked. Hmm....

  23. mail@paulbryan.name
    Member
    Posted 6 years ago #

    I had this problem in WPMU 2.5.

    I tried removing www. from all URL settings, that didn't fix it. Making sure all directories had the proper owner and group didn't fix it. Setting wp-content and everything inside to 775 didn't fix it.

    Finally, when I manually created the directory blogurl/wpcontent/blog.dir/blog#/files and set that directory to 777 it worked.

    I tried backing off that directory to 775, and it quit working, and the error message changes to HTTP Error - An error occurred in the upload please try later. Everything up to the files directory can be 755 and it still is okay.

    I don't want to leave this directory at 777, I hope someone will post if there is a good solution to this problem.

  24. demonicume
    Member
    Posted 6 years ago #

    preface: i moved my Mu from subdirectories to subdomains. I copied the blog directory from the old location to the new location. I got this error but with a twist

    'Unable to create directory...//2008/05'

    that double slash confused me. i tried everything that everyone here tried. then i renamed the numbered blogh directories. directory '1' because '1_old'. Mu then recreated the folder properly and everything works.

  25. Aaron Axelsen
    Member
    Posted 6 years ago #

    I am having the same problem as netman74501 reported above. Uploading works in IE fine, but refuses to work in firefox. Any ideas?

  26. Anonymous
    Unregistered
    Posted 6 years ago #

    I BELIEVE I HAVE FOUND A SOLUTION!

    I am using WP 2.6. I CH'MOD (777) the following directories:

    wp-content
    uploads
    *every folder/subfolder with uploads

    I then went to Settings > Miscellaneous > Full URL path to files (optional)

    I put in: http://yourdomain.org/wordpress/wp-content/uploads

    and made sure my uploads were set to:

    wp-content/uploads

    Hope this helps!

  27. mmcglynn
    Member
    Posted 5 years ago #

    I cannot believe that there is not yet a definitive answer here. Nothing from WP?

  28. Anonymous
    Unregistered
    Posted 5 years ago #

    Hello everybody,

    You should give a try to this fix. It worked for me (no need to chmod the 'uploads' directory to 777, but you have to be sure the user Apache is running under has enough rights to create any directory below 'uploads').

    Cheers,

    Stéphane

  29. blogono
    Member
    Posted 5 years ago #

    yesterday i had a similar problem with wpmu as pumpkinslayer described.

    here is how i solved it ...

    http://mu.wordpress.org/forums/topic.php?id=9077

  30. Anonymous
    Unregistered
    Posted 5 years ago #

    I had a similar fix myself. I basically deleted the default path for the "Store uploads in this folder" field in "settings/miscellaneous" and put the full path in the "Full URL path to files (optional)" field.

Topic Closed

This topic has been closed to new replies.

About this Topic