Forums

[resolved] Cannot modify header... Not solved by FAQ (12 posts)

  1. BlueStunt
    Member
    Posted 3 months ago #

    Ok, so I've looked everywhere I can think of for a solution, and I've been through this:

    http://codex.wordpress.org/Answers-Troubleshooting#Headers_already_sent

    Countless times but it doesn't help.

    The problem I'm getting is lots of version of this, whatever I try and do.

    <b>Warning</b>: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\wordpress\wp-content\themes\clinical\functions.php:1) in <b>C:\xampp\htdocs\wordpress\wp-content\plugins\twitter-tools\twitter-tools.php</b> on line <b>1106</b><br />

    Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\wordpress\wp-content\themes\clinical\functions.php:1) in C:\xampp\htdocs\wordpress\wp-includes\classes.php on line 1586

    Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\wordpress\wp-content\themes\clinical\functions.php:1) in C:\xampp\htdocs\wordpress\wp-includes\pluggable.php on line 865

    So I've followed the solution as detailed in the FAQ but it doesn't help, there are no extra characters at the start or end of my functions.php file.

    Any help will be greatly appreciated.

  2. t31os_
    Member
    Posted 3 months ago #

    Remove twitter tools, then see if the problem exists..

  3. BlueStunt
    Member
    Posted 3 months ago #

    I deleted three unused plugins, no change, it was never specifically to do with Twitter Tools, the error occurs when I add new posts, when I click the 'more' tag on the post creator, when I post comments. Virtually any action causes it.

  4. t31os_
    Member
    Posted 3 months ago #

    Disable all plugins, and switch to the default theme..

    If your installation then functions you know it's one of two things, either a plugin or the theme, then start enabling one thing at a time until the problem is re-produced..

    Also check your config file (wp-config.php) and make sure there's no extra spaces on the end, after the ending ?>

  5. BlueStunt
    Member
    Posted 3 months ago #

    I should have probably added that I'm new to wordpress and attempting to build a theme.

    Its definitely the theme that is at fault. With other themes active it's fine, and when I empty the functions.php file its fine.

    I've tried replacing the functions.php file with one from the classic and the default theme and it still doesn't work :/.

    Perhaps I'm writing a functions.php file wrongly? I can't seem to find any guides as to how they should be written though.

  6. BlueStunt
    Member
    Posted 3 months ago #

    Oh and I checked the wp-config file and there isn't an ending ?> I unzipped the 2.8.2 WordPress download and the sample doesn't have an end tag either.

  7. mrmist
    Member
    Posted 3 months ago #

    It tells you the error

    C:\xampp\htdocs\wordpress\wp-content\themes\clinical\functions.php:1

    There's probably a blank line at the start of that file. Which editor are you looking at it in?

    There's not meant to be a closing ?> at the end of wp-config.

  8. whooami
    Member
    Posted 3 months ago #

    Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\wordpress\wp-content\themes\clinical\functions.php:1) in <b>C:\xampp\htdocs\wordpress\wp-content\plugins\twitter-tools\twitter-tools.php</b> on line <b>1106</b><br />

    Its definitely the theme that is at fault.

    just like described in the faq :)

    DONT use a plain text editor, dont introduce spaces or other 'stuff' before the opening <?php

    thats precisely what that error suggests is happening.

  9. BlueStunt
    Member
    Posted 3 months ago #

    I'm using Notepad++, I may be new to Wordpress but not XHTML/CSS etc.

    With the show all characters option selected in Notepad++

    http://www.ispycreativity.com/uploads/wordpress-errors/wordpress-functions-php-show-all-chars.jpg

    The below images should (hopefully demonstrate that there are no extra characters.

    http://www.ispycreativity.com/uploads/wordpress-errors/wordpress-functions-php-top.JPG
    http://www.ispycreativity.com/uploads/wordpress-errors/wordpress-functions-php-bottom.JPG

    and the functions.php file, saved as phps (I've never used this format before).

    http://www.ispycreativity.com/uploads/wordpress-errors/functions.phps

    If someone manages to resolve this for me I'll be eternally indebted to them.

  10. BlueStunt
    Member
    Posted 3 months ago #

    Hmm, when the functions.php file is completely empty no errors occur, however when I add just

    <?php ?>

    the error occurs.

  11. BlueStunt
    Member
    Posted 3 months ago #

    I've just started a new theme and I'm still getting the same error even though I swear to god I'm doing it perfectly.

    I'm using the latest wordpress version on a local xampp install.

    The error I'm getting is:

    Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\wordpress\wp-content\themes\naturally-dark\functions.php:1) in C:\xampp\htdocs\wordpress\wp-includes\pluggable.php on line 865

    Could it be something to do with the fact it says C:\xampp\htdocs\ as opposed to http://localhost/?

  12. BlueStunt
    Member
    Posted 1 month ago #

    2 months later I finally found the solution. Thanks to: http://stackoverflow.com/questions/1067742/clean-source-code-files-of-invisible-characters

    The character was a Byte Order Mark "a Microsoft invention to tell, in a Unicode file, in which order multi-byte characters are stored.

    To get rid of it, tell your editor to save the file either as ANSI/ISO-8859 or as Unicode without BOM".

    To do this in Notepad++ go Format > Convert to UTF-8 without BOM then Format > Encode in UTF-8 without BOM.

Reply

You must log in to post.

About this Topic