• Resolved Aaron

    (@wd4015)


    I’m using the Multisite feature with my blog. I’m able to upload photos fine while posting to the main site. However, I’m unable to upload any media successfully to any of the other network sites. I receive the following error:

    “image.jpg” has failed to upload due to an error
    Unable to create directory /home/name/name.com/wp-content/blogs.dir/3/files/2011/06. Is its parent directory writable by the server?

    I have the permissions set to 777 on both wp-content and blogs.dir.

    My .htaccess file looks like this (which is set in the root of my domain):

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    # END WordPress

    Looks like everything should work…but it doesn’t. I wish WordPress was more helpful in their documentation regarding this common problem. Any help that anyone could give would be appreciated.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    It’s not a common problem, and not every solution works for every user, so … hard to document 😉 For the vast majority of people, it works out of the box.

    I have the permissions set to 777 on both wp-content and blogs.dir.

    Did you verify that the permissions were set correctly all the way down the line? Check 3/files/2011/06 ALL of those folders. Make sure they’re ALL 777.

    And did you check the user on that folder? What’s it CHOWNed to? And are you running SELinux?

    Thread Starter Aaron

    (@wd4015)

    I don’t see the 3/files/2011/06 directory in wp-content. I tried adding this myself and set the permissions to it, but it still didn’t work. I would think adding this in manually isn’t a very streamlined process and would be a pain adding the new directory every month and setting permissions to it.

    There is a user associated with wp-content and a group. I checked blogs.dir and a user and group was not assigned. I tried adding the user and group to the blogs.dir but received the following message:

    The operation couldn’t be completed. Could not change the owner of blogs.dir

    Error 5: unrecognized error number

    I’m not sure if I’m running SELinux or not. I may need to find this out from my host provider.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    You should NOT have to add them yourself, unless permissions are screwy. It’s probably a PHP setting that’s creating the folders in a way it can’t write to (yes, it happens :/ )

    Ask your host.

    Thread Starter Aaron

    (@wd4015)

    I could kick myself…I had blogs.dir as a file name instead of an actual name for a directory.

    Everything works great. Photos/media upload like a charm.

    Thanks for all the help!

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Yeah, that would do it 🙂

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Unable to upload images using Multisite’ is closed to new replies.