Warning: "Headers already sent" or "Cannot modify header information"
This error also presents as "Cannot modify header information" depending on PHP version.
In short, it means that somewhere in the code, something was printed to the browser before Drupal had finished preparing the page. This is most often caused by custom or modified code contributed from sources outside Drupal, so inspect your uniquely added code (including themes) first..
If you get a "Headers already sent" error, there are three likely causes.
If this error is not the first error message on the page, then it is most likely a 'avalanche effect' of previous errors and you may ignore it. Instead, focus on fixing the errors before it. When you fix the first error message(s), the "Headers already sent" error(s) will most likely disappear.
Text editors sometimes insert a UTF-8 byte order mark at the top of a file. In this case, the error message will usually say that "output started" at line 1 of some file. To fix this, configure your text editor to save the file without a byte order mark.
However, if you get an error "Headers already sent" as the first error and it tells you the error is near the end of a file (check which file "output started at" points to), that probably means that there are extra spaces or lines after a closing ?> php tag. In Drupal coding standards, it is strongly recommended (for this very reason) that PHP files should not have any closing ?> tags . Delete them, and everything should work fine.
Extra whitespace being added probably is caused by a bad unpacking program and / or a non-compliant editor (Windows Notepad or Wordpad, Mac TextEdit) adding it.
Problems with "headers already sent" can also be caused by having a blank line at the end of *.inc files. Drupal or more likely PHP seem to have problems with extra spaces here and there.
Check all *.inc files to make sure there are no closing php ?> tags in any of them. Closing php ?> tags are not needed in your *.inc files. Also, check all *.php files to make sure there are no blank lines at the beginning or at the end of the file.
If the error message indicates that this is caused by a module, disable modules one by one to find out which one is causing the problem.
This can also be caused by UTF-8. If a website is coded in ASCII and php files are being saved as UTF-8, it can cause this message. If the website and DB are both UTF-8, it should be ok to save php files as UTF-8.
Additionally, this error message is related to the "output_buffering" variable in php.ini. If output_buffering is set to some cache, the server will send headers with delay (or modify them shortly after they are sent), and this error will not be tripped. But, if output_buffering is set to 0 or not at all, then headers can be sent at only one moment and, if there's bad code, it will trip this error message. To sum up, turning on the "output_buffering" variable in php.ini fixes this problem.

I had a problem with the
I had a problem with the "headers already sent" too at my www.Maxi-Pedia.com website. In my case, it was caused by a blank line at the beginning of common.inc. Drupal or more likely PHP seem to have problems with extra spaces here and there.
Check all your *.inc files to make sure you do not have closing ?> in any of them. Closing ?> is not needed in your *.inc files. Check all your *.php files to make sure you do not have blank lines at the beginning or at the end.
If the error message indicates that this is caused by some module, disable your modules one by one to find out which one causes this.
This can also be caused by UTF-8. If you have your website coded in ASCII and are saving your php files as UTF-8, it can cause this message. If your website and DB are UTF-8, you should be ok with saving php files as UTF-8 though.
Btw, this error message is related to output_buffering on/off in your php.ini. If you have output_buffering set to some cache, the server will allow to send headers with delay (or to modify them shortly after they are sent), and this error will not be tripped. But if you set output_buffering to 0 or not at all, then headers can be sent at only one moment, and if you have some bad code, it will trip this error message.
----------------
Everything you ever needed to know: www.Maxi-Pedia.com
The output_buffering setting was the key - thank you
I've been looking for a solution as to why a Drupal site was giving me the white screen of death after any form submission that returned to the site itself (logging in, logging out, creating/modifying/deleting blocks, views, content, etc.), along with the error mentioned above. The submission would actually work when I checked afterwards, but I would be taken to a blank screen immediately following my submit. Finally, when I turned on output_buffering in php.ini this problem was fixed.
All I could find before now (after countless searches) was the idea of making sure that my php files didn't have any lines inserted after the closing php tag (?>). Thanks again!
I had the same problem,
I had the same problem, converting my file from UTF8 to ANSI ( I am using notepad++) worked.