WordPress.org

Support

Support » How-To and Troubleshooting » Unable to create directory – Is its parent directory writable by the server?

Unable to create directory – Is its parent directory writable by the server?

  • 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.

Viewing 15 replies - 1 through 15 (of 84 total)
  • Bump.

    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.

    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?

    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

    Matt

    @intellivision

    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.

    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.

    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.

    Matt

    @intellivision

    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? 🙁

    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)

    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).

    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.

    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

    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…

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

    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.

Viewing 15 replies - 1 through 15 (of 84 total)
  • The topic ‘Unable to create directory – Is its parent directory writable by the server?’ is closed to new replies.