Forum Replies Created

Viewing 15 replies - 1 through 15 (of 23 total)
  • Thread Starter djlivi

    (@djlivi)

    …and checking the tickbox now to close this!

    Thread Starter djlivi

    (@djlivi)

    I’m going to close this – whatever has happened, something is deeply wrong somewhere.

    I can bypass the problem using .htaccess to determine which blog is being addressed, and rewrite to the appropriate folder, along the lines of:

    RewriteCond %{HTTP:Host} ^(www\.)?blogone\.com$ [OR]
    RewriteCond %{HTTP:Host} ^blogonedotcom\.hostdomain\.com$
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-content/blogs.dir/3/files/$2 [L]

    I can repeat that block of code for each of the small number of blogs on my site – as the number of blogs is small and rarely added to, I can live with this.

    Not very happy, as this is clearly a hack workaround, and I’d much prefer to be able to properly fix whatever is broken… but it works.
    Will do until someday I move the entire host over…

    Thread Starter djlivi

    (@djlivi)

    The rule in the OP works for one of the blogs, by bypassing ms-files.php and going direct to the file – so the files are there alright.

    This is the latest in a relatively protracted series of attempts to fix up the site – it turned out that readfile was disabled previously but is enabled now.

    I have to admit that I’m pulling my hair out on this now – I’ve been going back and forward trying to sort this out, and just can’t get any further.

    I have the domain mapping plugin enabled, and all blogs work except for media and thumbnails – and htaccess is clearly working as noted in the OP. Trying to use ms-files.php always seems to result in a 500 error.

    Thread Starter djlivi

    (@djlivi)

    I’ve tried both of the following, neither of which works:

    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    # OR this
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

    (obviously not both at the same time)

    With either of these, images are completely broken – trying to load a single image giving a 500 error :-/

    djlivi

    (@djlivi)

    Sadly not for me, though almost all of the problem description matches my problem – looking at my wp_sitemeta table, there is no entry for ms_files_rewriting at all – adding it with a value of 1 doesn’t seem to improve things either. When I get the energy I’ll start a new thread ??

    For what it is worth, I seem to have an identical problem with broken image links (working .htaccess, WPMS install that used to work but now with broken image links except when editing the image itself)

    Also on 3.8.1, and also started on WPMU (unknown version number)
    I’ve followed this thread carefully, and path settings, etc are all as described by Sozomai

    Thread Starter djlivi

    (@djlivi)

    And to confirm: I had to reload some images that somehow got broken links along the way, but all is working now.

    Thread Starter djlivi

    (@djlivi)

    Now have readfile working on the blog… and I now have some images back. On some blogs, all images are back – on the blog I’ve been linking to only some images are back.
    I reckon that in all the previous attempts to fix things that weren’t broken, I must have broke something! Still, I’m hoping that I’ll be able to manage from here…

    Thanks again to all

    Thread Starter djlivi

    (@djlivi)

    Think I’ve found it, in an unexpected place – looks like php readfile() was disable for security purposes when php was last updated on the server.
    As you say, I might have been the only person using it…

    Have put in support ticket with my host, will let you know if this sorts it out…

    thanks again for all your help and suggestions!

    Thread Starter djlivi

    (@djlivi)

    Images vary a lot in size – includes trimmed headers and uploaded images. Header images might be 30k to 60k as jpg or png.

    Will do some more php tests to see if readfile works under any circumstances, if not then at least that’ll be problem…

    Thread Starter djlivi

    (@djlivi)

    5.3.18

    Just looking at build date listed on Phpinfo – which gives Nov 5th, so it could have been a php update that broke my images? (This is on a shared virtual server, so I would have expected other users to be affected)

    Thread Starter djlivi

    (@djlivi)

    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 =

    Thread Starter djlivi

    (@djlivi)

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

    Thread Starter djlivi

    (@djlivi)

    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 https://unversitydotorg.virtualba.co.uk/files/2012/06/UNversity-Banner2.jpg

    is re-written to:
    https://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…

    Thread Starter djlivi

    (@djlivi)

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

Viewing 15 replies - 1 through 15 (of 23 total)