Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Mar 2011
    Posts
    212
    Thanks
    10
    Thanked 1 Time in 1 Post

    confusing wordpress error

    Any idea what this error means? Im working on redoing my website, using this reallyyyy gorgeous template I found, but wordpress keeps giving me this warning


    Warning: Cannot modify header information - headers already sent by (output started at /home/content/58/8802958/html/wp-content/themes/Retro/haku/functions.php:1) in /home/content/58/8802958/html/wp-includes/pluggable.php on line 881



    my site is at coy-design.com

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,607
    Thanks
    6
    Thanked 997 Times in 970 Posts
    That means that in functions.php you have some kind of text/HTML output where it shouldn’t be because PHP is supposed to modify document header information which must happen before any output.

  • #3
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    And its super nice and easy.
    You either have a space on the first line (or other output perhaps?), or you have BOM prior to <?php on your functions script (denoted in the error as :1). Make sure you open in a plaintext editor such as notepad or vim, and save it back under ansi if you don't see a whitespace preceding the <?php. Don't save it in unicode.

  • Users who have thanked Fou-Lu for this post:

    lmorales (08-15-2012)

  • #4
    Regular Coder
    Join Date
    Mar 2011
    Posts
    212
    Thanks
    10
    Thanked 1 Time in 1 Post
    That worked! Thanks so much, quick question, I never saw an actual space, so I saved it under ansi as you suggested, why does that mess everything up?

  • #5
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Quote Originally Posted by lmorales View Post
    That worked! Thanks so much, quick question, I never saw an actual space, so I saved it under ansi as you suggested, why does that mess everything up?
    Unicode adds byte order markers that are not rendered in the document itself. Depending on the charset in use, unicode specifies 2 to 4 hex characters at the start of the text document to indicate what endian it uses, and are not treated as actual text (and are therefore illegible). Its fixed by opening and saving in a plain text editor with ansi, and sometimes you may need to go back in and remove the characters at the front of the document.

    BOM themselves don't damage PHP. It treats it as output text to the document, and HTML decides what to do with it. If it can render it, it will, otherwise it will ignore them. Problem in PHP comes to anything that requires the use of a header, so a direct call to headers, cookies, sessions, etc. Now it has output prior to the header call, which will force PHP to issue a warning since it's now incapable of pushing more information to the header stack. As soon as any output is present, it must flush the headers first, and then send that output to the client. There is no way to go back after headers are sent to queue more up.

  • Users who have thanked Fou-Lu for this post:

    lmorales (08-15-2012)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •