Problem: Cannot modify header information - headers already sent


Today i switch on my wamp server again to continue my development and for my suprise it stop work

it never happen to me since today, and nothing got changed since yesterday (nothing changed in server or files)

i try remove runtime files, but i got the same error: Cannot modify header information - headers already sent

Stack Lines:


983 setcookie($cookie->name,$value,$cookie->expire,$cookie->path,$cookie->domain,$cookie->secure,$cookie->httpOnly);

D:\wamp\www\yii\framework\web\CHttpRequest.php(983): setcookie("YII_CSRF_TOKEN", "6ebd3127f75f76adff94d65a18de686a3e07ed2bs:40:"3039261e6ac8693af3...", 0, "/", ...)

well anything that use hearder will tigger that error, like sessions

how can i fix?


I have multiple yii projects, and all the others works well without that error

only that project that i call ‘portal’ have this error

nevermind, i got the problem

in my template i was using:


<?php flush(); ?>


flush() its the cause