开发者

CakePHP: Cannot modify header information - headers already sent by [duplicate]

This question already has answers here: 开发者_如何学编程 How to fix "Headers already sent" error in PHP (11 answers) Closed 10 years ago.

Complete error:

Warning (2): Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/trunk/dafe/cake/basics.php:355) [CORE/cake/libs/controller/controller.php, line 743]

As far as I can tell it happens after I try to redirect. I know it's caused by a whitespace but I can't find it anywhere, where does this error tend to be?

EDIT: Forgot to mention, this problem only happens on my Mac, my partner working on windows does not have this issue, redirection works appropriately for him.


Two possibilities I know of: A. You might have some whitespace after the class closing PHP tag ?>.

B. You are trying to echo/ pr() during the processing of the data/ logic (-while it's redirecting, saving to the database, etc)


I had this Problem recently myself and searched for Blanks within my Code but didnt't find one. The simple Solution: Deactivated the debug mode (Configure::write(debug,0) and everything worked fine :)


I had a similar problem and tried removing white space, flush, etc... but nothing worked until I configured output_buffering to 'on' in my EZ php config interface on cpanel.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜