Magento Headers已经发送

Ven*_*tus 4 magento

我有Magento发送的Headers有这个问题.我收到此错误:

HEADERS ALREADY SENT: 
[0] /var/www/etam/trunk/src/app/code/core/Mage/Core/Controller/Response/Http.php:44
[1] /var/www/etam/trunk/src/lib/Zend/Controller/Response/Abstract.php:727
[2] /var/www/etam/trunk/src/app/code/core/Mage/Core/Controller/Response/Http.php:75
[3] /var/www/etam/trunk/src/app/code/core/Mage/Core/Controller/Varien/Front.php:188
[4] /var/www/etam/trunk/src/app/code/core/Mage/Core/Model/App.php:304
[5] /var/www/etam/trunk/src/app/Mage.php:596
[6] /var/www/etam/trunk/src/index.php:139
Run Code Online (Sandbox Code Playgroud)

我看到这个话题但对我帮助不大.

我发现只有在通过管理面板导航并使用WYSIWYG编辑器编辑页面时才能获得此日志.当在这样的编辑的内容有.jpg图像然后我得到这个标题已经发送错误.

据我所知,它不是适用于所有图像,而是适用于其中一些图像.例如,当只有1个图像时没有错误.当有3个时,只有一个我得到这个错误.

我找不到任何空格或不想要的echo,也不print.我坚持这个,我不知道要搜索什么.也许你可以给我一些建议?我知道它是无害的,我们仍然不想在system.log中有任何错误.

xyz*_*xyz 10

有时我们在system.log中看到"Headers Already Send ..."...为了防止这种情况,我们应该使用其中一种方法在控制器中返回我们的数据

干净的方式:

$this->getResponse()->setBody($response);

或脏的方式:

echo $response;

exit();

在某些情况下,"干净的方式"不起作用,所以我们必须使用"脏路".

如果您通过Ajax获取内容,请使用此方法,就像在CMS中完成的那样;)