December, 2010

[Fix] Cannot modify header information - headers already sent by


There is an easy way out in order to solve this problem. After several puzzling encounters why this warning occurs to some files, at last a solution has been carved out.

From my experience, the cause of this are the whitespaces before or after the <?php ... ?> tags. That is, if you use the header() function, make sure that the file or any files (required or included) associated with it has no whitespaces to begin with.

Let me share two articles that has a good explainations on this case: