WordPress.org

Ready to get started?Download WordPress

Forums

Warning: Cannot modify header information - header (13 posts)

  1. page_
    Member
    Posted 10 years ago #

    Ok, just downloaded the latest stable version and am trying to install it on a linux server. PHP Version 4.3.6 is running as CGI.
    Got through all the install steps ok, and I'm now at the login screen. When I try to login, I'm getting the following errors...
    Warning: Cannot modify header information - headers already sent by (output started at /path/to/wp/wp-login.php:3) in /path/to/wp/wp-login.php on line 124
    Warning: Cannot modify header information - headers already sent by (output started at /path/to/wp/wp-login.php:3) in /path/to/wp/wp-login.php on line 128
    Warning: Cannot modify header information - headers already sent by (output started at /path/to/wp/wp-login.php:3) in /path/to/wp/wp-login.php on line 131
    Warning: Cannot modify header information - headers already sent by (output started at /path/to/wp/wp-login.php:3) in /path/to/wp/wp-login.php on line 133
    Warning: Cannot modify header information - headers already sent by (output started at /path/to/wp/wp-login.php:3) in /path/to/wp/wp-login.php on line 134
    Warning: Cannot modify header information - headers already sent by (output started at /path/to/wp/wp-login.php:3) in /path/to/wp/wp-login.php on line 135
    Warning: Cannot modify header information - headers already sent by (output started at /path/to/wp/wp-login.php:3) in /path/to/wp/wp-login.php on line 136
    Warning: Cannot modify header information - headers already sent by (output started at /path/to/wp/wp-login.php:3) in /path/to/wp/wp-login.php on line 156
    The only other solutions I've found for this in the forums is to delete the last blank line on vars.php . I've since gone through all the files that are called from wp-login.php and sub-required files to delete any last blank lines of the file. I've done a lot of tweaking and several blank installs but all to no avail.
    Love to hear your suggestions to get this running...

  2. page_
    Member
    Posted 10 years ago #

    ok got it sorted. I had to go through all the word press files that set cookies and/or send out header information and wrap them in ob_start() -> ob_end_flush();
    It's going to make upgrading in the future a pain, so could the WP team look at wrapping all header information in these functions?

  3. Nick Momrik
    Member
    Posted 10 years ago #

    The most common problem that gives the "headers already sent" message is an extra blank line before the <?php or after the ?> in the config file or the hacks file.

  4. foolfillment
    Member
    Posted 10 years ago #

    I'm getting similar errors, I've checked my wp-config file for that problem but it wasn't the cause, any ideas?
    my error goes along the lines of :

    Warning: Cannot modify header information - headers already sent by (output started at /usr/local/psa/home/vhosts/mydomain.co.uk/httpdocs/refer/refer.php:164) in /usr/local/psa/home/vhosts/mydomain.co.uk/httpdocs/wp/wp-login.php on line 109

  5. Anonymous
    Unregistered
    Posted 9 years ago #

    The reason you're getting this error is because you're using a call to a header function after you've printed (echoed) text to the html.
    When using a header function, it is a php requirement to utilize it before any html is displayed.
    To avoid this problem, what I usually do is, rather than echo lines of html, I store the html in a variable. Then, I do the test if(condition) then print html else header.
    This way, you avoid printing out html, and the header function will be valid.

  6. Anonymous
    Unregistered
    Posted 9 years ago #

    thanks to this site!

  7. Anonymous
    Unregistered
    Posted 9 years ago #

    I got the same error and it was fixed by deleting the extra spaces before <?Php and after the ?>

  8. stfarm
    Member
    Posted 9 years ago #

    Hi guys, I have the same problem. Did you ever get this fixed?
    I run WP 1.5

    Thank you,

    Steve
    http://www.GeekTavern.com

  9. Mark (podz)
    Support Maven
    Posted 9 years ago #

  10. davejenbarnes
    Member
    Posted 9 years ago #

    Thanks, MtDewVirus, for your suggestion about the blank lines... I had a bunch of the "Warning: Cannot modify header information blah-blah-blah warnings in my WP admin screens and deleting the extra lines in the file it referenced (at the end, no less!) totally solved my problem!

    Thanks again!

  11. richards1052
    Member
    Posted 9 years ago #

    MtDewVirus: I'm getting this error (which began after activating a plugin--why would activating a plugin that already had been deactivated & then reactivated cause this) & I have no extra lines at the beginning or end of the file. To be safe, I deleted every blank line in the entire file, then saved.

    Still getting errors.

    UPDATE: I examined one of the files causing the error & it was for a plugin that not only wasn't active, but I was sure I deleted it. ONce I deleted that file, the error stopped. BTW, the file causing the conflict had no blank lines or spaces in it either at the beginning or end.

  12. Please quote the error here.

    UPDATE: Nevermind

  13. sguler
    Member
    Posted 8 years ago #

    I also got the same error,
    Thanks to MtDewVirus... now it is working...

    Street Racing Videos

Topic Closed

This topic has been closed to new replies.

About this Topic