WordPress.org

Ready to get started?Download WordPress

Forums

Multisite images cannot be displayed in subsites (43 posts)

  1. progers
    Member
    Posted 2 years ago #

    define('WP_ALLOW_MULTISITE', true);
    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', true );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'www.playcreativeinc.com' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );
  2. There's no extra $base in there?

  3. progers
    Member
    Posted 2 years ago #

    No, there is only one base definition. I copied this in from the Network Setup under Settings on Network Admin.

  4. progers
    Member
    Posted 2 years ago #

    Doing some more reading in the forums and I noticed in this thread:

    http://wordpress.org/support/topic/new-30-install-images-not-working-in-subsites/page/2#post-1662597

    oliverobrien suggested adding ob_clean() before the readfile in ms-files.php:

    // If we made it this far, just serve the file
    ob_clean();
    readfile( $file );
    ?>

    This fixed the problem with the images not displaying!

    I guess this will work for now but I would really like to figure out the original problem so I don't have to modify WordPress core files.

  5. Further in that thread:

    Just to update - the above workaround worked (and was necessary in the first place) because I had managed to somehow add an additional newline character after the closing ?> in wp-config.php.

  6. progers
    Member
    Posted 2 years ago #

    I read that section as well and double-checked my wp-config.php. I found that it doesn't even have an ending ?> tag. I'm not sure why that is, it doesn't seem correct syntactically. I downloaded the latest version of WordPress and even the wp-config-sample.php also has it set up this way.

  7. It's not incorrect. Do you have a blank line at the end?

    Like

    dzfdsf
    
    dfsdfs
    
    [the end]
  8. progers
    Member
    Posted 2 years ago #

    I have 2 lines of code and 2 lines of returns:

    105: /** Sets up WordPress vars and included files. */
    106: require_once(ABSPATH . 'wp-settings.php');
    107:
    108:
  9. Delete the blank lines in 107 and 108.

  10. progers
    Member
    Posted 2 years ago #

    I deleted the extra returns at the end of my wp-config.php file and also removed the ob_clean(); line of code from wp-includes/ms-files.php to see if this would fix the original problem without modifying WordPress core files.

    I'm sorry to report that it does not fix the original problem. I went back in and added ob_clean();

  11. It's got to be something with how your server is configured :/

    I suppose it'd be time to research exactly what ob_clean() is doing.

  12. object81
    Member
    Posted 2 years ago #

    Thanks progers and oliverobrien

    oliverobrien suggested adding ob_clean() before the readfile in ms-files.php:

    // If we made it this far, just serve the file
    ob_clean();
    readfile( $file );
    ?>
    This fixed the problem with the images not displaying!

    Hope someone comes up with a permanent fix. Annoying to edit core files.

Topic Closed

This topic has been closed to new replies.

About this Topic