The MU forums have moved to WordPress.org

Error in Site Admin > Upgrade Blogs (16 posts)

  1. emdee90
    Member
    Posted 17 years ago #

    While attempting to upgrade the blogs on my muWP site, I receive the following error:

    (I replaced my url with WEBSITE because it's not really 'ready to launch' yet).

    Anyone have any ideas? THX

    ------------------------------------------------------
    Warning: fopen() [function.fopen]: URL file-access is disabled in the server configuration in /home/.chardonnay/WEBSITE/WEBSITE.com/wp-inst/wp-admin/wpmu-upgrade-site.php on line 27

    Warning: fopen(http://eatsleepfly.WEBSITE.com/wp-admin/upgrade.php?step=1) [function.fopen]: failed to open stream: no suitable wrapper could be found in /home/.chardonnay/WEBSITE/WEBSITE.com/wp-inst/wp-admin/wpmu-upgrade-site.php on line 27
    http://desertdog.WEBSITE.com/

    Warning: fopen() [function.fopen]: URL file-access is disabled in the server configuration in /home/.chardonnay/WEBSITE/WEBSITE.com/wp-inst/wp-admin/wpmu-upgrade-site.php on line 27

    Warning: fopen(http://desertdog.WEBSITE.com/wp-admin/upgrade.php?step=1) [function.fopen]: failed to open stream: no suitable wrapper could be found in /home/.chardonnay/WEBSITE/WEBSITE.com/wp-inst/wp-admin/wpmu-upgrade-site.php on line 27
    http://strandby.WEBSITE.com/

    Warning: fopen() [function.fopen]: URL file-access is disabled in the server configuration in /home/.chardonnay/WEBSITE/WEBSITE.com/wp-inst/wp-admin/wpmu-upgrade-site.php on line 27

    Warning: fopen(http://strandby.WEBSITE.com/wp-admin/upgrade.php?step=1) [function.fopen]: failed to open stream: no suitable wrapper could be found in /home/.chardonnay/WEBSITE/WEBSITE.com/wp-inst/wp-admin/wpmu-upgrade-site.php on line 27
    http://flyhigh.WEBSITE.com/

    Warning: fopen() [function.fopen]: URL file-access is disabled in the server configuration in /home/.chardonnay/WEBSITE/WEBSITE.com/wp-inst/wp-admin/wpmu-upgrade-site.php on line 27

    Warning: fopen(http://flyhigh.WEBSITE.com/wp-admin/upgrade.php?step=1) [function.fopen]: failed to open stream: no suitable wrapper could be found in /home/.chardonnay/WEBSITE/WEBSITE.com/wp-inst/wp-admin/wpmu-upgrade-site.php on line 27
    http://bigjohn.WEBSITE.com/

    Warning: fopen() [function.fopen]: URL file-access is disabled in the server configuration in /home/.chardonnay/WEBSITE/WEBSITE.com/wp-inst/wp-admin/wpmu-upgrade-site.php on line 27

    Warning: fopen(http://bigjohn.WEBSITE.com/wp-admin/upgrade.php?step=1) [function.fopen]: failed to open stream: no suitable wrapper could be found in /home/.chardonnay/WEBSITE/WEBSITE.com/wp-inst/wp-admin/wpmu-upgrade-site.php on line 27

  2. emdee90
    Member
    Posted 17 years ago #

    Still having the error today!

    Anyone know if this has been addressed in the new nightly build?

  3. donncha
    Key Master
    Posted 17 years ago #

    It's a problem on your server. You need to allow fopen to open URLs. Talk to your admins, it's usually disabled as a security precaution.

  4. emdee90
    Member
    Posted 17 years ago #

    Thanks, I'll give it a go!

  5. emdee90
    Member
    Posted 17 years ago #

    My admin's response:

    ---------------------------
    That's the php function url_fopen, and we've disabled it for security
    reasons, and won't re-enable it. We've provided the alternative cURL,
    http://wiki.dreamhost.com/index.php/CURL which is a complete replacement
    for url_fopen.
    ----------------------------

    Any ideas on how to do this?

  6. emdee90
    Member
    Posted 17 years ago #

    I suspect the file is wpmu-upgrade-site.php but not quite sure how to incorporate Dreamhosts work-around. :(

  7. kahless
    Member
    Posted 17 years ago #

    There is a patch for this at http://wpmudevorg.wordpress.com/project/Upgrade-Sites-Snoopy-Patch but the patch is outdated I think. I tried the patch a while ago on my DreamHost test install and it failed. I tracked down the changes that needed to be made and posted them in this thread http://mu.wordpress.org/forums/topic.php?id=802&replies=3#post-4219 but I'm not sure if it will work on very recent builds. You might give it a try.

  8. kahless
    Member
    Posted 17 years ago #

    donncha,

    It is not a server problem. If you have time to fix snoopy then people shouldn't need fopen. You can try the code I posted in http://mu.wordpress.org/forums/topic.php?id=802&replies=3#post-4219 which seems to have a nested if error, but works otherwise.

  9. kahless
    Member
    Posted 17 years ago #

    Try replacing the entire contents of wpmu-upgrade-site.php with

    <?php
    require_once('admin.php');

    $title = __('WPMU Admin');
    $parent_file = 'wpmu-admin.php';
    require_once('admin-header.php');
    if( is_site_admin() == false ) {
    die( __('You do not have permission to access this page.') );
    }
    if (isset($_GET['updated'])) {
    ?><div id="message" class="updated fade"><?php _e('Options saved.') ?></div><?php
    }
    print '<div class="wrap">';
    switch( $_GET[ 'action' ] ) {
    case "upgrade":
    if( isset( $_GET[ 'n' ] ) == false ) {
    $n = 0;
    } else {
    $n = $_GET[ 'n' ];
    }
    $blogs = $wpdb->get_results( "SELECT * FROM $wpdb->blogs WHERE site_id = '$wpdb->siteid' AND spam = '0' AND deleted = '0' AND archived = '0' ORDER BY registered DESC LIMIT $n, 5", ARRAY_A );
    if( is_array( $blogs ) ) {
    foreach( $blogs as $details ) {
    if( $details[ 'spam' ] == 0 && $details[ 'deleted' ] == 0 && $details[ 'archived' ] == 0 ) {
    $siteurl = $wpdb->get_var( "SELECT option_value from {$wpmuBaseTablePrefix}{$details[ 'blog_id' ]}_options WHERE option_name = 'siteurl'" );
    print "$siteurl<br>";
    if($http_fopen){
    $fp = fopen( $siteurl . "wp-admin/upgrade.php?step=1", "r" );
    if( $fp ) {
    while( feof( $fp ) == false ) {
    fgets($fp, 4096);
    }
    fclose( $fp );
    }
    }
    } elseif(!$http_fopen) {
    //while a bit slower than fopen (i'm guessing),
    //This will definitely work if allow_url_fopen is off.
    $client = new Snoopy();
    @$client->fetch($siteurl . "wp-admin/upgrade.php?step=1");
    } else {
    print "Not upgrading: {$details[ 'domain' ]}<br>";
    }
    }
    ?>
    If your browser doesn't start loading the next page automatically click this link: ">Next Blogs
    <script language='javascript'>
    <!--

    function nextpage() {
    location.href="wpmu-upgrade-site.php?action=upgrade&n=<?php echo ($n + 5) ?>";
    }
    setTimeout( "nextpage()", 250 );

    //-->
    </script>
    <?php
    } else {
    print "All Done!";
    }
    break;
    default:
    ?>
    You can upgrade all the blogs on your site through this page. It works by calling the upgrade script of each blog automatically. Hit the link below to upgrade.
    Upgrade Site
    <?php
    break;

    }
    ?>
    </div>
    <?php include('admin-footer.php'); ?>

    I just tested it on Rev 564 and it didn't generate any errors, but this is a fresh install with nothing to upgrade.

  10. kahless
    Member
    Posted 17 years ago #

    Sorry for double post, but I noticed that the links were formated in the post and weren't displayed. Tried to escape them and it didn't work. Let's see if this works.

    <?php
    require_once('admin.php');

    $title = __('WPMU Admin');
    $parent_file = 'wpmu-admin.php';
    require_once('admin-header.php');
    if( is_site_admin() == false ) {
    die( __('You do not have permission to access this page.') );
    }
    if (isset($_GET['updated'])) {
    ?><div id="message" class="updated fade"><?php _e('Options saved.') ?></div><?php
    }
    print '<div class="wrap">';
    switch( $_GET[ 'action' ] ) {
    case "upgrade":
    if( isset( $_GET[ 'n' ] ) == false ) {
    $n = 0;
    } else {
    $n = $_GET[ 'n' ];
    }
    $blogs = $wpdb->get_results( "SELECT * FROM $wpdb->blogs WHERE site_id = '$wpdb->siteid' AND spam = '0' AND deleted = '0' AND archived = '0' ORDER BY registered DESC LIMIT $n, 5", ARRAY_A );
    if( is_array( $blogs ) ) {
    foreach( $blogs as $details ) {
    if( $details[ 'spam' ] == 0 && $details[ 'deleted' ] == 0 && $details[ 'archived' ] == 0 ) {
    $siteurl = $wpdb->get_var( "SELECT option_value from {$wpmuBaseTablePrefix}{$details[ 'blog_id' ]}_options WHERE option_name = 'siteurl'" );
    print "$siteurl<br>";
    if($http_fopen){
    $fp = fopen( $siteurl . "wp-admin/upgrade.php?step=1", "r" );
    if( $fp ) {
    while( feof( $fp ) == false ) {
    fgets($fp, 4096);
    }
    fclose( $fp );
    }
    }
    } elseif(!$http_fopen) {
    //while a bit slower than fopen (i'm guessing),
    //This will definitely work if allow_url_fopen is off.
    $client = new Snoopy();
    @$client->fetch($siteurl . "wp-admin/upgrade.php?step=1");
    } else {
    print "Not upgrading: {$details[ 'domain' ]}<br>";
    }
    }
    ?>
    If your browser doesn't start loading the next page automatically click this link:
    <a href="?action=upgrade&n=<?php echo ($n + 5) ?>">Next Blogs</a>
    <script language='javascript'>
    <!--

    function nextpage() {
    location.href="wpmu-upgrade-site.php?action=upgrade&n=<?php echo ($n + 5) ?>";
    }
    setTimeout( "nextpage()", 250 );

    //-->
    </script>
    <?php
    } else {
    print "All Done!";
    }
    break;
    default:
    ?>
    You can upgrade all the blogs on your site through this page. It works by calling the upgrade script of each blog automatically. Hit the link below to upgrade.
    <a href="wpmu-upgrade-site.php?action=upgrade">Upgrade Site</a>
    <?php
    break;

    }
    ?>
    </div>
    <?php include('admin-footer.php'); ?>

    I just tested it on Rev 564 and it didn't generate any errors, but this is a fresh install with nothing to upgrade.

  11. emdee90
    Member
    Posted 17 years ago #

    Thank you, I will give this a try immediately.

    Thank you for your help!

  12. emdee90
    Member
    Posted 17 years ago #

    It works!

    Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you!

  13. samchng
    Member
    Posted 17 years ago #

    Wow! Where did you get this code kahless. Havent tried it, but it's good news.

  14. kahless
    Member
    Posted 17 years ago #

    Fimion made the patch and did the tough stuff. I just noticed it wasn't working with later builds and reworked it. Not sure it is 100% but it will let the upgrade work on hosts that don't allow fopen.

  15. samchng
    Member
    Posted 17 years ago #

    Thanks ;)

  16. amanzi
    Member
    Posted 17 years ago #

    Great work kahless (and fimion) - hope the wpmu dev's pick this up soon.

About this Topic