WordPress.org

Support

Support » Installation » Warning: Cannot modify header information – header

Warning: Cannot modify header information – header

  • 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…

Viewing 12 replies - 1 through 12 (of 12 total)
  • 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?

    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.

    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

    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.

    thanks to this site!

    Anonymous

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

    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

    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!

    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.

    Moderator James Huff

    @macmanx

    Please quote the error here.

    UPDATE: Nevermind

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

    Street Racing Videos

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Warning: Cannot modify header information – header’ is closed to new replies.
Skip to toolbar