WordPress.org

Forums

[resolved] What does this mean? (23 posts)

  1. UltraMegaOK1988
    Member
    Posted 7 years ago #

    When I go to publish a blog, I get the following error:

    Warning: Cannot modify header information - headers already sent by (output started at /home/crasbae2/public_html/wp-content/themes/beautifulsunrise/functions.php:72) in /home/crasbae2/public_html/wp-includes/pluggable.php on line 331

    My site is: http://www.crashburnalley.com

    It published, but not to my main page. It just appears here:

    http://crashburnalley.com/?p=3

    And I can't add categories without getting a similar message.

  2. The theme you're using (beautifulsunrise) has extra blank lines in its functions.php file. Probably at the bottom. Remove any and all spaces or blank lines after the final "?>" in that file. functions.php must produce NO OUTPUT or you get that sort of error.

  3. UltraMegaOK1988
    Member
    Posted 7 years ago #

    I don't think there are any spaces. I put it in Word where it shows all of the spaces and line breaks and I didn't see anything out of the ordinary.

    Would you like me to post the code?

  4. UltraMegaOK1988
    Member
    Posted 7 years ago #

    The error also occurs when you click the RSS feed link.

    http://crashburnalley.com/

    It's at the bottom of the right hand column.

  5. I don't think there are any spaces.

    I really wasn't asking you if there are any spaces. I'm telling you that there absolutely *are* spaces or linefeeds or some other sort of blank space. They're on line 72. The error message itself tells you exactly what is wrong, if you know how to read it.

    Your functions.php file in your theme is broken because of these. It's as simple as that.

    If you can't fix it, use another theme.

    Oh, and do not use Word. Use a text editor, like TextPad or even Notepad. Word is not a text editor.

  6. Root
    Member
    Posted 7 years ago #

    Otto42 knows stuff. :)

  7. UltraMegaOK1988
    Member
    Posted 7 years ago #

    Yeah, I'm not familiar with PHP.

    I use TextPad as my HTML/CSS editor.

  8. UltraMegaOK1988
    Member
    Posted 7 years ago #

    With this error:

    /home/crasbae2/public_html/wp-content/themes/beautifulsunrise/functions.php:72) in /home/crasbae2/public_html/wp-includes/pluggable.php on line 331

    I'm going to the file and the exact line and I don't see extra spaces.

    Line 72 of functions.php:

    $dateformatstring = ' '.$dateformatstring;

    The code around it:

    $datemeridiem_capital = $wp_locale->get_meridiem(date('A', $i));
    		$dateformatstring = ' '.$dateformatstring;
    		$dateformatstring = preg_replace("/([^\\\])D/", "\\1".backslashit($dateweekday_abbrev), $dateformatstring);

    Line 331 of pluggable.php:

    header("Location: $location");

    The code around it:

    else {
    		if ( php_sapi_name() != 'cgi-fcgi' )
    			status_header($status); // This causes problems on IIS and some FastCGI setups
    		header("Location: $location");
    	}
  9. IcelandDream
    Member
    Posted 7 years ago #

    Go to your theme directory and open each .php file. Go to the bottom and make sure that it ends with a ?> and *nothing* else.
    You likely have a carriage return or space after the final ?>

  10. moshu
    Member
    Posted 7 years ago #

    You have reading difficulties, my friend: You were given the exact answer, you just have to carefully read it instead of arguing and posting irrelevant code!
    The answer was:

    The theme you're using (beautifulsunrise) has extra blank lines in its functions.php file.

    Not WP's own wp-includes/functions.php but the functions file in your theme folder.

    The error message you posted in bold in your OP says it clearly:
    wp-content/themes/beautifulsunrise/functions.php:72)

  11. UltraMegaOK1988
    Member
    Posted 7 years ago #

    I'm not arguing at all. I just have never used PHP before and I don't understand it. I appreciate your help and patience.

    Thanks for the clarification.

  12. Root
    Member
    Posted 7 years ago #

    Well php is like the Marine Corps. When we say no blank lines after that last php thing we mean it. No carriage return, no space, no period. Nothing.

  13. UltraMegaOK1988
    Member
    Posted 7 years ago #

    Okay, so I'm getting this error too:

    Warning: Cannot modify header information - headers already sent by (output started at /home/crasbae2/public_html/wp-content/themes/beautifulsunrise/functions.php:72) in /home/crasbae2/public_html/wp-login.php on line 12

    I'm in that file -- wp-login.php -- and Line 12 has this:

    header('Content-Type: '.get_bloginfo('html_type').';

    Now, there is a space after that semicolon. Should I erase that? When I do, this becomes attached to the semicolon:

    charset='.get_bloginfo('charset'));

    Sorry for my PHP ignorance, I didn't think I'd have to use it. :(

    What is a carriage return, by the way?

  14. Root
    Member
    Posted 7 years ago #

    Could you reinstall from the svn? The zip has been a bit hit and miss lately.

  15. UltraMegaOK1988
    Member
    Posted 7 years ago #

    svn?

    And do you mean a zip file?

    I guess I could try a reinstall from the zip file I downloaded. I don't know what svn is.

  16. UltraMegaOK1988
    Member
    Posted 7 years ago #

    Ahhh.......

    I reinstalled and now I can't even access my wp-login page.

    Warning: Cannot modify header information - headers already sent by (output started at /home/crasbae2/public_html/wp-content/themes/bsunrise/functions.php:72) in /home/crasbae2/public_html/wp-login.php on line 12

    Warning: Cannot modify header information - headers already sent by (output started at /home/crasbae2/public_html/wp-content/themes/bsunrise/functions.php:72) in /home/crasbae2/public_html/wp-includes/pluggable.php on line 331

    This = frustrating. You have to be a web design genius to do this stuff.

    This is the theme I downloaded:

    http://themes.wordpress.net/columns/2-columns/3534/beautiful-sunrise-10/

    Could you download it and check the file -- maybe it's the file that's wrong, not my installation. It's all gibberish to me.

  17. Root
    Member
    Posted 7 years ago #

    What v of WP are you using?

  18. IcelandDream
    Member
    Posted 7 years ago #

    To eliminate the theme as a problem you should remove the theme's directory (you have a backup copy...). This will force WP to use the default theme. If that fixes the problem then you can try to fix the theme or use a different one.

  19. mrmist
    Forum Janitor
    Posted 7 years ago #

    This tells you where to start looking

    output started at /home/crasbae2/public_html/wp-content/themes/bsunrise/functions.php:72

    You need to open that file, in a text editor that will show you blank lines, and get rid of them. The particular lines you are interested in are these ones ..

    echo $html; } }
    ?>
    
    <?php
    
    define('HEADER_TEXTCOLOR', '');

    Between the ?> and the <? They are lines 70 and 71 in the file.

    HTH.

  20. moshu
    Member
    Posted 7 years ago #

    Ultra,
    you should really sit down, take a deep breath and read the instructions before starting to re-install and doing foolish things.
    You are always looking at the WRONG files, although we have told you several times which file to look for and which line in it.

    Your error is always the same, READ IT and don't post back until you find this file and this line:

    themes/beautifulsunrise/functions.php:72)
    72 is the line# where you have the blank or space after ?>
    What is so complicated?
    You are looking at all the wrong files and posting nonsense... instead of READING ONE SINGLE LINE OF INSTRUCTIONS AND FOLLOW IT.

    You are hopeless.

  21. UltraMegaOK1988
    Member
    Posted 7 years ago #

    Thanks for the tips.

    I'm sorry I'm not experienced enough with PHP to know this stuff.

    Put yourself in your shoes back when you first started parsing code. Did it not look like gibberish?

    That's what it looks like to me. Sorry for my ignorance.

    --

    New problem: In my dashboard, when I go to add a category to my blogroll (i.e. uncategorized, blogroll, and now I want to add 'reference' as a category), and I click the 'add' button, it does nothing.

    And once I add a link to my blogroll, I can't delete it. I click the button, and it has that delete animation, but it just shows up again.

    This probably has something to do with editing the PHP files just a minute ago if any of this follows logically.

  22. UltraMegaOK1988
    Member
    Posted 7 years ago #

    I'm just going to have my host wipe the slate clean and I'll reinstall WordPress and a different template.

  23. Root
    Member
    Posted 7 years ago #

    Adding a cat won't do anything until there is a post allocated to the cat in question. I repeat my idea. Do not use the zip file download if you can avoid it. Download from the svn if you can. Windows users need puTTY. And ssh which a good host allows.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.