WordPress.org

Ready to get started?Download WordPress

Forums

Warning: Cannot modify header information - headers already sent by (output star (19 posts)

  1. wingheaded
    Member
    Posted 5 years ago #

    I have installed Xampp but when i'm about to login i get this message,please help:

    Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\wordpress\wp-config.php:1) in C:\xampp\htdocs\wordpress\wp-admin\install.php on line 36

    After i make the login there are severall error reports like this ones:

    Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\wordpress\wp-config.php:1) in C:\xampp\htdocs\wordpress\wp-login.php on line 255

    Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\wordpress\wp-config.php:1) in C:\xampp\htdocs\wordpress\wp-login.php on line 267

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

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

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

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

  2. Samuel B
    moderator
    Posted 5 years ago #

    that error states there is a blank line before the opening php statement
    there can not be any blank lines after the closing php statement either

  3. livingdenver
    Member
    Posted 4 years ago #

    I am receiving these and if I could log in to take out the blank lines, great, but I cannot log in I just received the warnings. Can you help me get around the problem so I can post to my page?

  4. s_ha_dum
    Member
    Posted 4 years ago #

    Login to your web-host via FTP, or use your host's backend rather than WP's to do the edit.

  5. laudes
    Member
    Posted 4 years ago #

    I posted this on another thread with same issue: here goes a solution:
    Paste ob_start(); at the TOP of my functions.php file (Was the file generating the error messages)

    Solved Issue

  6. ultrageek
    Member
    Posted 4 years ago #

    I have had my blog up for about 6 months now, however, thanks to some hackers, I have been forced to wipe everything, including the DB and re-install fresh.

    I am getting the same "Cannot modify header information..." errors when running the install. This is brand new install, with empty DB.

    Adding the ob_start() did not help.

    errors from the install login -
    Warning: Cannot modify header information - headers already sent by (output started at /home/leeandlo/public_html/blogs/general/wp-includes/default-filters.php:214) in /home/leeandlo/public_html/blogs/general/wp-login.php on line 290

    Warning: Cannot modify header information - headers already sent by (output started at /home/leeandlo/public_html/blogs/general/wp-includes/default-filters.php:214) in /home/leeandlo/public_html/blogs/general/wp-login.php on line 302

    errors from after entering login information -

    Warning: Cannot modify header information - headers already sent by (output started at /home/leeandlo/public_html/blogs/general/wp-includes/default-filters.php:214) in /home/leeandlo/public_html/blogs/general/wp-login.php on line 290

    Warning: Cannot modify header information - headers already sent by (output started at /home/leeandlo/public_html/blogs/general/wp-includes/default-filters.php:214) in /home/leeandlo/public_html/blogs/general/wp-login.php on line 302

    Warning: Cannot modify header information - headers already sent by (output started at /home/leeandlo/public_html/blogs/general/wp-includes/default-filters.php:214) in /home/leeandlo/public_html/blogs/general/wp-includes/pluggable.php on line 662

    and others

  7. s_ha_dum
    Member
    Posted 4 years ago #

    @laudes,

    I'm not sure that putting ob_start at the beginning of function.php is a good idea, especially if you aren't closing it. You are basically throwing everything into server memory when you do that. Besides, if functions.php is echoing something where it shouldn't be the fix would be to find what is being echoed and stop it, rather than just cover it up.

    @ultrageek,

    First thing I'd try would be re-uploading all of your files directory by directory. FTP can hang and files end up missing or corrupt.

  8. ultrageek
    Member
    Posted 4 years ago #

    I have copied the whole WP directory structure to the server at least 6 times. Of course, this time it worked. It seems that I just needed someone to make the official suggestion for it to work for me.
    Thanks.

  9. s_ha_dum
    Member
    Posted 4 years ago #

    I have copied the whole WP directory structure to the server at least 6 times.

    Depending on your FTP software and your finickiness of your server, it might just take that many times. I speak from experience with one particular server. Other servers have done better. I've given up on FTPing the wordpress directory and instead upload subdirectories-- wp-admin, wp-includes... Even those I'll do twice to make sure everything went. (My FTP software will tell me before it uploads what has and hasn't been uploaded previously, so I can skip files already sent.)

  10. j.mcduffie
    Member
    Posted 4 years ago #

    Removing the blank lines in my functions.php file (in my current theme's folder) solved the header issue for me.

  11. laudes
    Member
    Posted 4 years ago #

    @apljdi

    I agree with your statement as to server memory etc. I strongly suggest one use this only for development (localhost). On 2 occasions I've experienced "Mod header" issues , for it to simply disappear once all back-end coding has been completed.

  12. thirds_c
    Member
    Posted 4 years ago #

    Samboll - you are amazing! thankyou!

  13. Babysenkids.nl
    Member
    Posted 4 years ago #

    Samboll - I dont have any blank line but this script in lines 663 to 670:

    663 // Set httponly if the php version is >= 5.2.0
    664 if ( version_compare(phpversion(), '5.2.0', 'ge') ) {
    665 setcookie($auth_cookie_name, $auth_cookie, $expire, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN, $secure, true);
    666 setcookie($auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, $secure, true);
    667 setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, COOKIE_DOMAIN, false, true);
    668 if ( COOKIEPATH != SITECOOKIEPATH )
    669 setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, false, true);
    670 } else {

    see no blank lines.. and have the same problem..

    any ideas?

  14. owzzz
    Member
    Posted 4 years ago #

    i get the same as Babysenkids.nl

    Any idea why this might be happening? it locks me out of the admin panel, There are no spaces on the code... the lines of code it refers to is:

    setcookie($auth_cookie_name, $auth_cookie, $expire, PLUGINS_COOKIE_PATH, $cookie_domain, $secure);
    setcookie($auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, $cookie_domain, $secure);
    setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, $cookie_domain);
    if ( COOKIEPATH != SITECOOKIEPATH )
    setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, $cookie_domain);
    }
    }
    endif;

    This is the second time it has happened now.. I wondering If its to do with plugins? I've tried taking the plugins out of the plugins folder but it seems to have little effect..

    any ideas on this?

  15. owzzz
    Member
    Posted 4 years ago #

    I've worked out that it has something to do with the theme I've created.. when I take the theme out of the theme folder using ftp, the problem goes away...

    the pluggable.php seems to be affected.. has anyone found a solution to this? I'm at a dead at with it at the minute..

  16. Stefan_K
    Member
    Posted 4 years ago #

    Samboll: right on the money!

    one of the quicker WP solutions...

    Thank You!

  17. Kristine Dudina
    Member
    Posted 4 years ago #

    Samboll- thanks a lot! Your advise worked for me as well. Found an empty line in wp-cofig.php .

  18. stepenfleming110
    Member
    Posted 4 years ago #

  19. spiritfree1
    Member
    Posted 4 years ago #

    Thanks so much Samboll. That was exactly it.

    @ babysenkids and owzzz or if anyone's still wondering:

    It took me a minute to figure this out as well. It is a bit confusing when you see 4 line numbers telling you there's a problem and none of them are php<? lines, but if you look at the parenthetic ( ) portion in the error message before it comes to stating the line number, you will probably find that all the different line numbers in referenced files, refer to just one "(output started in... FILENAME.php: line# xyz)". That file all the lines will have in common, and that line number is likely to be at the end of the file. Either the ?> is missing at the end of the file, or after the "?> and carriage return to the next line", there is not only that last line, but one or two empty lines after it.

    Three of my problems were solved by deleting the extra lines. So owzzz, instead of being your entire theme, it is likely only one or two files within it.

    Hope this helps clarify. Thanks again Samboll!!

Topic Closed

This topic has been closed to new replies.

About this Topic