WordPress FAQ

Ask a Question

How do I solve the “Headers already sent” warning problem?

Description: You get a warning message on your browser that says:

Warning: Cannot modify header information - headers already sent by
(output started at…

Reason and Solution :
It is usually because there are spaces, newlines, or other garbage
before an opening '< ?php' tag or after a closing '?>' tag, typically in
wp-config.php. This could be true about some other file too, so please check the file that gave you the error too (mentioned in the error message).

Filed under: —   2fargon 

18 Comments »

  1. tried all the fixes, but cant get past initial login screen. no error messages just nothing…

    Comment by m gahagan — 7/31/2004 @ 11:38 am

  2. Why does this thing have so many errors?

    Comment by lia — 9/1/2004 @ 4:39 am

  3. The “Thing” has few errors. This error and a few others are caused by careless humans :).
    We are yet a few steps away from Software that is 100% tolerant of human errors.

    Comment by Carthik — 9/1/2004 @ 4:44 am

  4. I truly don’t mean to be rude. It just seems as if so many people have to go through so much just to get wordpress working. Whileas the other scripts I’ve tried took only moments to install.

    Comment by lia — 9/1/2004 @ 4:52 am

  5. lia, let’s not confuse the few for the whole.
    There are approximately 20000 wp blogs, and fewer than 1123 installation help requests at the support forums as I write this.
    All web based tools, where you have to install something are complicated. I have wordpress to thank for not having to write my own blog tool :)

    Comment by Carthik — 9/1/2004 @ 5:48 am

  6. I had the same “cannot modify header information - headers already sent by (output started at /home/LOCATION/wp-config.php:35) in /home/LOCATION/wp-login.php

    for lines 123, 124, 126, 127, 128, 129, and 149.

    It turns out there are extra blank spaces at the end of the file – why, I don’t know, since I just changed the database information. But that is the solution, at least for me. Get rid of those lines/spaces.

    Comment by Aleta — 9/13/2004 @ 8:08 pm

  7. I was getting this error.. apparently there was one extra paragraph thing at the end of the doc.. deleted it and as if by magic.. voila.. it is working..

    thanks for a great tool btw.. i love it..

    Comment by can — 9/18/2004 @ 11:31 pm

  8. […] . A instalacão do Wordpress tem um probleminha no login. Maiores detalhes neste endereco: . O arquivo que estava com este problema não foi necessariamente o mencionado no faq, mas sim o wp-config.php. […]

    Pingback by Linuxer in Japan » Problemas na Instacão do Wordpress — 9/19/2004 @ 7:45 am

  9. i have problems like ur aleta ..there was one extra paragraph thing at the end of the doc.. deleted it but ……still cant fix my problems…the extra line still stay with peace :)

    Comment by kusaeni — 9/19/2004 @ 10:50 pm

  10. Ok ….well i have been trying again and…….its work great thaks

    Comment by kusaeni — 9/19/2004 @ 11:48 pm

  11. I’m having the same problem but the line won’t delete. I keep trying but to no avail. Any help?

    Comment by Kyle.iSamurai — 9/27/2004 @ 5:59 pm

  12. I love this…. your tip was pretty much helpful for me… but, still wondering… where did those spaces come from :-O

    Comment by Tasneem — 10/6/2004 @ 11:13 am

  13. It must have crept in when you edited wp-config.php especially if you edited it online, using cpanel or similar.

    Comment by Carthik — 10/6/2004 @ 11:47 am

  14. Okay, so if you try this and you’re still getting header errors, what do you do? I did have whitespace at the end of my config file but I have changed that and am still having problems. I haven’t checked every single file, but I’ve opened the ones I am accessing and there is no extra whitespace.

    Comment by Christina — 10/16/2004 @ 12:25 pm

  15. Wow! I had the same error and now it works so well! I love you guys!

    Comment by Ranjani — 10/24/2004 @ 1:45 pm

  16. I just moved my site from a server in my basement to professional hosting company I used Dreamweaver to FTP the html and PHP files. Then I dumped the database and restored it by hand using the hosting company’s cpanel and phpadmin tool. Afterwards, I could browse the site fine, but I had problems loggin in.

    For reasons I can’t explain, the wp-config.php file and a number of carrage returns. Maybe it was the FTP but who really knows???

    I deleted the carriage returns and everything is working fine now.

    Thanks for your help.

    dMitri

    Comment by dMitri — 11/22/2004 @ 12:47 am

  17. Post #6

    “It turns out there are extra blank spaces at the end of the file …”

    Yep - that fixed it for me as well - thanks. :)

    Comment by Von Aras — 12/5/2004 @ 2:14 pm

  18. THANK YOU THANK YOU THANK YOU!!! I had a stupid space at the end of an include and it was a mjor problem - it is now fixed thanks to your great insight!

    Comment by Shawn Raloff — 12/16/2004 @ 11:32 am

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <code> <em> <i> <strike> <strong>


Powered by WordPress | How to Burn a DVD