The MU forums have moved to WordPress.org

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

  1. blogono
    Member
    Posted 5 years ago #

    after i have moved my wpmu-site to another webhost, i get problems with permissions.

    _________________

    so far i have found this as a similar problem ...

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

    _________________

    at image-upload or user header-config the bloggers get:

    Unable to create directory /home/blogy/public_html/wp-content/blogs.dir/22/files//2008/08. Is its parent directory writable by the server?

    so, the problem is that wp-mu is unable to create the reqired directories.

    perhaps i have changed the user/group-permission through root-ssh, when i have moved?

    my user and root are now called both "blogono". i have no idea, what they were called at my old host. i can not access ftp there anymore to find out.

    i would like to try change the permission-config with ...

    chmod -R yourusername:yourusergroup full/path/to/wpmu/wp-content/blogs.dir

    but dont know, what user/group name to use. is there any file, that has these values?
    i just found this thread with good hints ..

  2. andrea_r
    Moderator
    Posted 5 years ago #

    If you're going in command-line to chmod, just ls -l to see the ownership and permissions.

  3. blogono
    Member
    Posted 5 years ago #

    hi andrea,
    thank you for the help!!

    when i enter "ls -l", as you said, i get ...

    total 1252
    drwxr-x--- 13 root root 4096 Aug 5 04:47 ./
    drwxr-xr-x 21 root root 4096 Jul 30 23:24 ../
    drwx------ 7 root root 4096 Jul 4 05:10 .MirrorSearch/
    -rw------- 1 root root 9161 Aug 4 21:11 .bash_history
    -rw-r--r-- 1 root root 24 Jan 6 2007 .bash_logout
    -rw-r--r-- 1 root root 191 Jan 6 2007 .bash_profile
    -rw-r--r-- 1 root root 176 Jan 6 2007 .bashrc
    drwxr-xr-x 4 root root 4096 Jul 4 05:42 .cpanel/
    drwx------ 3 root root 4096 Jul 4 04:23 .cpobjcache/
    -rw-r--r-- 1 root root 100 Jan 6 2007 .cshrc
    drwx------ 2 root root 4096 Jul 4 03:15 .gnupg/
    -rw------- 1 root root 1024 Jul 26 00:50 .rnd
    drwx------ 3 root root 4096 Jul 4 05:33 .spamassassin/
    drwx------ 2 root root 4096 Jul 26 00:46 .ssh/
    -rw-r--r-- 1 root root 129 Jan 6 2007 .tcshrc
    drwxr-xr-x 9 root root 4096 Jul 30 23:10 APC-3.0.19/
    drwxr-xr-x 4 root root 4096 Jul 25 20:46 cpanel3-skel/
    drwxr-xr-x 7 root root 4096 Jul 4 03:09 installd/
    -rw-r--r-- 1 root root 1161028 Jul 2 19:09 latest
    -rw-r--r-- 1 root root 20985 May 15 06:45 package.xml
    drwxr-xr-x 2 root root 4096 Jul 25 21:16 public_ftp/
    drwxr-xr-x 3 root root 4096 Jul 25 21:16 public_html/

    ________________________________________________

    in winSCP, when i am in the home directory, i see the following values

    http://img227.imageshack.us/my.php?image=permissionsyi4.jpg

    ________________________________________________

    so my wpmu-directory ("blogono") with "blogono" as owner(german -> besitzer) & group. should i change both to "root" to make it work and be able to create directories??

    ---

    this blogono directory in home has chmod 0711

    http://img329.imageshack.us/my.php?image=permissions2ng5.jpg

    ---

    should i now try to change the owner/group of this directory, both to root?

    eg
    chown -R root:root home/blogono/

    ________________________________________________

    or is something else the problem?

  4. andrea_r
    Moderator
    Posted 5 years ago #

    no, they shouldn't be root. that's the issue. See?

    "drwxr-xr-x 3 root root 4096 Jul 25 21:16 public_html/"

    So

    chown -R blogono:blogono public_html/

    Or whatever you webaccount name is. :D

    To be fair, when I'm moving stuff around on the server, this happens to me too.

  5. blogono
    Member
    Posted 5 years ago #

    thank you very much andrea, for helping me!!!

    i have tried almost everything. also your tip with ..

    chown -R blogono:blogono public_html/

    nothing worked.

    ________________________________

    then i renamed the "blogs.dir" to "oldblogs.dir" and created a new directory called "blogs.dir". chmod -> 0777

    now the bloggers were able to create directoryies and upload pictures, ...

    i saw that the blogger-directories in blogs.dir had "nobody" as owner/group.

    to keep the proviously uploaded pictures and files i have done the following ...

    rename this new created blogs.dir to anything eg. testblogs.dir

    rename the original-dir with all the files from oldblogs.dir back to blogs.dir

    ---------

    change the owner&group of the dir & all files in the directory to nobody

    ---------

    chown -R nobody /home/blogono/public_html/wp-content/blogs.dir

    +

    chgrp -R nobody /home/blogono/public_html/wp-content/blogs.dir

    ---------

    change the owner&group of the directory itself to root

    ---------

    chown root /home/blogono/public_html/wp-content/blogs.dir

    +

    chgrp root /home/blogono/public_html/wp-content/blogs.dir

    +

    chmod -> 0777 the blogs.dir

    ________________________________

    thats how i solved that to let the blogger upload stuff again. hope that i have not misconfigurated anything.

  6. camner
    Member
    Posted 5 years ago #

    There are a lot of posts about this issue both on this forum and elsewhere. I ran into this issue recently as well. I have shared hosting, and after a lot of digging, this is what I found out (YMMV...):

    0. The fundamental issue here seems to be about who "owns" the folder 'blogs.dir' and its subfolders. If one runs ones own server and has complete access to everything on it, ownership is straightforward to determine and change, if needed. If one is on shared hosting, folder ownership is largely invisible, and one can't typically change it oneself.

    1. When Wordpress MU is first installed, all of the files and folders have owner and group set to whatever username the server is set to assign for you (if you are on shared hosting, that decision is made by the host, not you!)

    2. Until the first time one tries to upload an image, the wp-content folder does NOT contain a folder called 'blogs.dir'.

    3. The first time an image is uploaded, a folder called 'blogs.dir' is created. The owner and group for this folder and all of its subfolders is set to 'nobody'. I have no idea why it is important for 'blogs.dir' to have different ownership, but it seems to matter a great deal.

    4. The implications of having a folder set to 'nobody' is that one cannot delete it or upload files directly to it using FTP, but one CAN upload files using the WPMU file/image uploader.

    5. If, for any reason, blogs.dir or any of its subfolders has its ownership changed away from 'nobody', the uploading of images will fail with the famous error message "...is its parent directory writeable by the server?"

    6. Some people have tried to solve this by changing file/folder permissions. Some have succeeded by changing the permissions to 777. Others have not had this work. The issue does not seem to be fundamentally a permissions issue but an ownership issue.

    7. With shared hosting, I couldn't even SEE the ownership of the files and folders until I asked my host to enable SSH access. Via SSH access I could see the ownership by typing ' ls -l ' I still couldn't change the ownership to 'nobody' and had to have my webhost do it for me.

    8. Once 'blog.dir' and all subfolders and files had both its owner and group set to 'nobody', everything worked normally.

    I hope this post is helpful to some people. Obviously a lot of us have torn our hair out over it!

  7. rcwatson
    Member
    Posted 5 years ago #

    Hopefully someone will see this reply to a 2 month-old post. We recently upgraded WPMU to 2.6.2. I've done everything suggested in this thread, but I still get the same error message.

    Unable to create directory /usr1/webroot/wordpress/wp-content/blogs.dir/30/files//2008/10. Is its parent directory writable by the server?

    Here is the listing of the blogs.dir directory:

    4 drwxrwxr-x 8 nobody nobody 4096 Aug 14 19:37 .
    4 drwxrwxrwx 7 wordpress wordpress 4096 Oct 2 20:35 ..
    4 drwxrwxr-x 3 nobody nobody 4096 Jun 3 19:34 1
    4 drwxrwxr-x 3 nobody nobody 4096 Aug 4 14:03 15
    4 drwxrwxr-x 3 nobody nobody 4096 Jul 31 14:26 17
    4 drwxrwxr-x 3 nobody nobody 4096 Aug 14 19:37 18
    4 drwxrwxr-x 3 nobody nobody 4096 May 8 16:38 3
    4 drwxrwxr-x 3 nobody nobody 4096 Jun 18 14:00 5

    I've tried chown to apache, wordpress, and now nobody. I've also tried chmod to 666 and now back to 775.

    Now what can I do?

  8. VentureMaker
    Member
    Posted 5 years ago #

    Does your PHP run in CGI mode or as Apache module?

  9. andrea_r
    Moderator
    Posted 5 years ago #

    "/blogs.dir/30/files//2008/"

    Note the double-slash in there.

  10. rcwatson
    Member
    Posted 5 years ago #

    Yeah, I noticed the double slash. Others have reported it as well, including the person that started this post, but he/she seems to have gotten it to work despite that. Is there a place in the options or settings of 2.6.2 to adjust any extraneous leading slashes? I knew where it was in 1.3.3, but the menus and screens are all different in 2.6.2.

    Thanks.

  11. rcwatson
    Member
    Posted 5 years ago #

    Aha! We figured it out. The files needed to be owned by "jrun". This should have been obvious to me because jrun is what is picking up the HTTP request and handling the file writing for the upload.

    Thanks!

  12. Success
    Member
    Posted 5 years ago #

    camner post is very true.

    I am facing the same problem also. http://mu.wordpress.org/forums/topic.php?id=9888

    Image upload don't work when I chown owner/group to username.

    Image upload only work when I chown to nobody. But when it's set to nobody, I cannot delete the files via ftp.

    So, what should be the correct or recommended owner/group settings for blogs.dir?

    How about uploads folder and .htaccess?

  13. twop
    Member
    Posted 5 years ago #

    THIS FIXED MY PROBLEM:

    I was playing with some of the settings that weren't mentioned in any of the posts I found on the forums and was able to fix the problem WITHOUT messing with permissions and safe-mode. When logged into Wordpress dashboard(wp-admin url page) I went to settings>miscellaneous. I changed 'Store uploads in this folder' to 'wp-content/uploads' (mine was this by default but I made sure it was this since I read it could cause this problem if it wasn't this), then I unchecked the 'Organize my uploads into month- and year-based folders' box. Unchecking this box and saving the changes is what solved my problem.

  14. tdjcbe
    Member
    Posted 5 years ago #

    Yes, that's the work around when you don't have permissions set or your server is locked down and won't allow the webserver to create subdirectories.

  15. jdkwebconsulting.com
    Member
    Posted 5 years ago #

    Changing the owner back to nobody on blogs.dir did it for me.

    http://www.tech-recipes.com/rx/66/recursively-change-the-owner-of-all-files-in-a-directory/

    Here is a good article that explains how to change the ownership.

    I like to use winscp. Click on the folder where I need to change the permission. Then click cusstom on winscp, go to the terminal and then enter the command described her.

    Change the owner to nobody.

    Regards,
    Justin

  16. nabtron
    Member
    Posted 4 years 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/

  17. kris32
    Member
    Posted 4 years ago #

    nabtron
    NO its not, how about you read the post before you start spamming your own blog?

  18. nabtron
    Member
    Posted 4 years ago #

    ya i know, i was to post it in another thread, but it got pasted here, and i dont have a link to delete it. so!

About this Topic