Published by Niels on 02 Apr 2010
Error: Cannot modify header information…
If PHP ever gives you the following error (I just encountered it while developing with the Yii Framework):
Cannot modify header information - headers already sent by
Then you probably injected some whitespace somewhere in your output. The easiest way to avoid that is by not using the PHP closing tag ‘?>‘ at the end of PHP source files. Some people are against that but if I look into the sources for Yii and read the Zend Framework Programmer’s Reference Guide then it is obviously a well established method of avoiding the mentioned error.