WordPress.org

Support

Support » Multisite » [Resolved] Yet another WPMU image problem

[Resolved] Yet another WPMU image problem

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

    @ipstenu

    The image that should be shown can still be accessed via a url using the ftp path from /wp-content/, e.g.:
    http://unversity.org/wp-content/blogs.dir/5/files/2012/09/IMAG1062-1024×613.jpg

    Okay, the image SHOULD be accessed at http://unversity.org/wp-content/files/2012/09/IMAG1062-1024×613.jpg

    What do you see there?

    That link gives a page not found error.
    Within webpages on the blog, URLs for images are created with the pattern /files/2012/06/UNversity-Banner1.jpg (i.e. without the wp-content/ – and those links lead directly to a to broken image icon, rather than the page not found error.

    I’m confirming that mod_rewrite is still enabled on the server, but as this was working until very recently I think it has to have been a 3.4.2 update issue.

    Also just discovered that the [content] and [archives] shortcodes that I use on one of my blogs dont appear to work now either. Not sure if this is in any way related.

    Well, it isn’t a problem with mod-rewrite. So back to having no idea what has happened (or isn’t happening that should be)

    I also checked for rogue .htaccess files, but there is indeed only the one, with the wordpress rules shown above.

    Still wondering if anyone can help with this one!

    ps Im using the wordpress MU domain mapping plugin:
    http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/

    Not sure whether this is a likely/possible issue – but everything worked until very recently.

    Just tried the following standard steps again:
    – deactivating all plugins to see if this resolves the problem. It didn’t.
    – switching to the Twenty Eleven theme to rule out any theme-specific problems. Already on this theme
    – resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems. Didn’t help
    – re-uploading all files & folders – except the wp-content folder – from a fresh download of WordPress. No change at all.

    To confirm, I can still upload images, and they are placed in the correct blogs.dir subfolder. But the URLs that WordPress is generating to access those images are not resolving correctly. My Media Library on all blogs shows only broken images, and all use of uploaded images (as headers or in posts) is now broken.

    Although this problem persists with plugins off, I am wondering if there is any connection with domain mapping.

    Andrea Rennick

    @andrea_r

    Customer Care at Copyblogger Media and Studiopress

    If you mapped the domain and manually edited the site details, that would be why.

    Look at the beginning of the URL – is it the mapped domain or the original blog address?

    Do the sub blogs work when they are not mapped?

    The first time I ever tried to manually edit site details was when trying to fix this 🙂
    Media works on the ‘master’ blog (which I don’t actually use, so I hadn’t tested it up till now) – but that simply uses the /wp-content/uploads folder without re-writes.

    Switching off mapping on sub-domains doesn’t seem to help though:
    http://unversitydotorg.virtualba.co.uk/files/2012/06/UNversity-Banner2.jpg
    still doesnt work.

    http://unversitydotorg.virtualba.co.uk/wp-content/blogs.dir/5/files/2012/06/UNversity-Banner2.jpg *does* work though.

    Completely lost here 🙁

    ps I thought that at least changine the file upload URL in settings to http://unversitydotorg.virtualba.co.uk/wp-content/blogs.dir/5/files would fix this, but it doesn’t actually seem to have any effect at all (unless the page is being cached somewhere between me and the server)

    Andrea Rennick

    @andrea_r

    Customer Care at Copyblogger Media and Studiopress

    Switching off mapping on sub-domains doesn’t seem to help though:
    http://unversitydotorg.virtualba.co.uk/files/2012/06/UNversity-Banner2.jpg
    still doesnt work.

    http://unversitydotorg.virtualba.co.uk/wp-content/blogs.dir/5/files/2012/06/UNversity-Banner2.jpg *does* work though.

    Then check your htaccess rules, as that is what controls the switching.

    .htaccess is as listed at the top of this thread. .htaccess is definately working and enabled, as I can create my own arbitrary rewrite rules and test them. And is the only .htaccess file on my server.

    I recopied the rules from the setup page within WPMU itself just incase there was a typo there that I couldn’t spot.

    Wondering if perhaps there are some settings/values being used by the scripts that do the final part of the mapping in wp-includes/ms-files.php that might be messing up.

    Though Im thinking now of taking the extreme measure of just putting all my blogs into maintenance mode until 3.5 is out. 🙁

    Moderator Ipstenu (Mika Epstein)

    @ipstenu

    Next step is ‘Check your httpd.conf and make sure AllowOverride is set to ALL’

    Update on where I’m at…
    AllowOverride All is set.
    I put some echo statements and a die at the head of wp-includes/ms-files.php.
    This was enough to verify that http://unversitydotorg.virtualba.co.uk/files/2012/06/UNversity-Banner2.jpg

    is re-written to:
    http://unversitydotorg.virtualba.co.uk/wp-includes/ms-files.php?file=2012/06/UNversity-Banner2.jpg

    Now going to try to work out why this isn’t serving the correct file…

    … and the correct file name with the full path is being passed to the readfile() command at the end of the script. The correct filesize is being added to the header.
    If I try to force download in the script, it downloads a file of size 0 though.
    Have to admit that this is as likely some weird server error as it is a wordpress one, but no idea what that might be 🙁

    Readfile is silently failing. Which is something Im at a loss to think how to fix.

    For info,
    I commented out the central part of the body of ms-files.php – everything after it determines the full path name.
    At the end I added the following:

    echo "<br />Made it to the end of ms-files.php. <br /> File is: " . $file;
     echo "<br /> is size " . filesize( $file );
     if (file_exists($file))
       echo "<br /> file exists.";
     else
       echo "<br /> file not found.";
     if (!readfile($file))
       echo "<br /> readfile failed.";
     else
       echo "<br /> readfile succeeded.";
     echo "<br /> readfile returned filesize = " . readfile($file);

    And the result I get when visiting a media file is:

    Made it to the end of ms-files.php.
    File is: /home/virtual/public_html/wp-content/blogs.dir/5/files/2012/06/UNversity-Banner2.jpg
    is size 37334
    file exists.
    readfile failed.
    readfile returned filesize =

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘[Resolved] Yet another WPMU image problem’ is closed to new replies.
Skip to toolbar