The MU forums have moved to WordPress.org

Unserialize Problem? (12 posts)

  1. hhuskies
    Member
    Posted 16 years ago #

    Okay, I turned error reporting ON because lately every once in a while my blogging system just displays a white page with no text. (which I believe is a sign that there is a PHP error)

    So I turned it on, and I got a lot of error code on my home page. http://www.sleddoggin.com/blogs/

    Now it looks like I have a couple of problems in the code. These are just some of them.

    Notice: unserialize(): Error at offset 0 of 13 bytes in /home/sleddog-admin/public_html/blogs/wp-includes/functions.php on line 258

    Following is the code on that line: if (! unserialize($value) )

    Notice: Undefined variable: pagenow in /home/sleddog-admin/public_html/blogs/wp-content/mu-plugins/akismet.php on line 535

    Following is the code on that line: if ( 'moderation.php' == $pagenow ) {

    So do you think the problem with the system is possibly the Akismet plugin? Or am I having a problem with unserialized error?

    You can view the other bugs at: http://www.sleddoggin.com/blogs/

    Thanks,

    Christian

  2. hhuskies
    Member
    Posted 16 years ago #

    Here are a couple more errors on the home page. What other information do I need to send over?

    Notice: Undefined variable: current_site in /home/sleddog-admin/public_html/blogs/wpmu-settings.php on line 2

    Warning: Cannot modify header information - headers already sent by (output started at /home/sleddog-admin/public_html/blogs/wpmu-settings.php:2) in /home/sleddog-admin/public_html/blogs/wp-includes/wpmu-functions.php on line 77

    Warning: Cannot modify header information - headers already sent by (output started at /home/sleddog-admin/public_html/blogs/wpmu-settings.php:2) in /home/sleddog-admin/public_html/blogs/wp-includes/wpmu-functions.php on line 78

    Warning: Cannot modify header information - headers already sent by (output started at /home/sleddog-admin/public_html/blogs/wpmu-settings.php:2) in /home/sleddog-admin/public_html/blogs/wp-includes/wpmu-functions.php on line 79

  3. hhuskies
    Member
    Posted 16 years ago #

    Okay, so I am thinking that I am having a problem with my headers? One of my error codes says that header information has already been sent out; and then it gives me these lines in wpmu-functions

    if( defined( "WP_INSTALLING" ) == false ) {
    header( "X-totalblogs: " . get_blog_count() );
    header( "X-rootblog: http://" . $current_site->domain . $current_site->path );
    header( "X-created-on: " . $current_blog->registered );

    Now when I have error reporting turned on, I have a lot of error codes AND I still have the actual site mixed in with the errors. Does this help anyone to turn me into what direction my problem is in?

    Thanks,

    Christian

  4. andrea_r
    Moderator
    Posted 16 years ago #

    "Cannot modify header information - headers already sent by" almost always means blank space at the end of files. check 'em. There should be nothing, not even a carriage return at the end of the last ? >

  5. hhuskies
    Member
    Posted 16 years ago #

    So say you have this file:

    ---------------------------

    ?>
    //return space goes here
    //return space goes here

    --------------------------

    You would want to make sure that the VERY last line is ?> and no more spaces are beyond it? If this is the case I DO think that some of my files do you blank lines after the ?> php end tag.

    Thanks!

  6. andrea_r
    Moderator
    Posted 16 years ago #

    Yep, you got it. Take those blank lines out.

  7. hhuskies
    Member
    Posted 16 years ago #

    Thanks Andrea_r! Now I have learned something of importance today; and if I ever get those error messages in my programming career I will know where to look! :-)

  8. andrea_r
    Moderator
    Posted 16 years ago #

    Other things can cause them, but that's the most common, and the first thing I look for. :)

  9. Konstan
    Member
    Posted 16 years ago #

    Hmm I dont seem to get errors from having spaces after ?> but I noticed that when I download the latest zip from mu.wordpress.org all the files have 1 or 2 new lines after ?>

    Is that normal? Should I get rid of those extra lines/spaces?

  10. hhuskies
    Member
    Posted 16 years ago #

    Hhmm, for some reason I just got rid of all the spaces after the ?> in my main blog root folder so far, and now nothing is being displayed on the blog home page. I am thinking that once I fix ALL files, then it will become consistent and work again?

    (even when I turn on error reporting, nothing is displayed)

    The one file I WASN'T able to edit and remove the extra space at the end of the file was the wp-config.php file. It said that my permission were denied, and I couldn't edit it. Could this be why my blog system failed all of the sudden?

  11. hhuskies
    Member
    Posted 16 years ago #

    Okay, so now EVERY space after the ?> command has been removed from the entire system; and the headers already sent out errors aren't being shown anymore. But I have two new errors, and the blogs don't show anymore.

    Here they are:

    Notice: Undefined variable: current_site in /blogs/wpmu-settings.php on line 2

    Parse error: parse error, unexpected T_LNUMBER in /blogs/wp-includes/formatting.php on line 90

    Here is the information I have on those lines for the corresponding error messages:

    --------------------------

    <?php
    if( $current_site && $current_blog )
    return;

    --------------------------

    AND

    --------------------------
    if (ord($Str[$i]) 0x80) continue; # 0bbbbbbb

    --------------------------

    On the formatting.php code area, it almost seems like there is a syntax error somewhere in there, or something missing. On Dreamweaver it says it's all wrong, and ALL of the PHP is highlighted in red. Here is the code SURROUNDING line 90 on formatting.php

    -------------------------

    function seems_utf8($Str) { # by bmorel at ssi dot fr
    for ($i=0; $i<strlen($Str); $i++) {
    if (ord($Str[$i]) 0x80) continue; # 0bbbbbbb
    elseif ((ord($Str[$i]) & 0xE0) == 0xC0) $n=1; # 110bbbbb
    elseif ((ord($Str[$i]) & 0xF0) == 0xE0) $n=2; # 1110bbbb
    elseif ((ord($Str[$i]) & 0xF8) == 0xF0) $n=3; # 11110bbb
    elseif ((ord($Str[$i]) & 0xFC) == 0xF8) $n=4; # 111110bb
    elseif ((ord($Str[$i]) & 0xFE) == 0xFC) $n=5; # 1111110b
    else return false; # Does not match any model
    for ($j=0; $j$n; $j++) { # n bytes matching 10bbbbbb follow ?
    if ((++$i == strlen($Str)) || ((ord($Str[$i]) & 0xC0) != 0x80))
    return false;
    }
    }
    return true;
    }

    Thanks for all of your help!

  12. hhuskies
    Member
    Posted 16 years ago #

    I'm wondering, should I just replace that entire function with the new and improved one from php.net?

    ------------------------------------------

    function seems_utf8($Str) {
    for ($i=0; $i<strlen($Str); $i++) {
    if (ord($Str[$i]) < 0x80) continue; # 0bbbbbbb
    elseif ((ord($Str[$i]) & 0xE0) == 0xC0) $n=1; # 110bbbbb
    elseif ((ord($Str[$i]) & 0xF0) == 0xE0) $n=2; # 1110bbbb
    elseif ((ord($Str[$i]) & 0xF8) == 0xF0) $n=3; # 11110bbb
    elseif ((ord($Str[$i]) & 0xFC) == 0xF8) $n=4; # 111110bb
    elseif ((ord($Str[$i]) & 0xFE) == 0xFC) $n=5; # 1111110b
    else return false; # Does not match any model
    for ($j=0; $j<$n; $j++) { # n bytes matching 10bbbbbb follow ?
    if ((++$i == strlen($Str)) || ((ord($Str[$i]) & 0xC0) != 0x80))
    return false;
    }
    }
    return true;
    }

About this Topic

  • Started 16 years ago by hhuskies
  • Latest reply from hhuskies