【发布时间】:2016-04-26 13:32:34
【问题描述】:
我在我的 Magento 1.9.1.0 上使用模板,在使用 SUPEE 6788 进行修补后,我的 system.log 中出现以下错误:
2016-04-26T00:50:23+00:00 DEBUG (7): Cannot send headers; headers already sent in /usr/share/nginx/html/app/code/community/Ves/Tabs/controllers/IndexController.php, line 140
2016-04-26T00:50:23+00:00 DEBUG (7): HEADERS ALREADY SENT: <pre>[0] /usr/share/nginx/html/app/code/core/Mage/Core/Controller/Response/Http.php:52
[1] /usr/share/nginx/html/lib/Zend/Controller/Response/Abstract.php:771
[2] /usr/share/nginx/html/app/code/core/Mage/Core/Controller/Response/Http.php:84
[3] /usr/share/nginx/html/app/code/core/Mage/Core/Controller/Varien/Front.php:184
[4] /usr/share/nginx/html/app/code/core/Mage/Core/Model/App.php:354
[5] /usr/share/nginx/html/app/Mage.php:684
[6] /usr/share/nginx/html/index.php:87
在第 140 行的 IndexController.php 中,我有以下代码:
echo Mage::helper('core')->jsonEncode( $json );
我认为调用 json 的方式会导致此错误。我该如何解决这个问题?
提前致谢。
【问题讨论】:
-
您是否在某些文件的结束 php 标记之后或开始标记之前检查了空格?也看看这个..stackoverflow.com/questions/4670031/…
-
@severinolorillajr 我验证了每个文件都没有成功。
-
@Hallan 请注意,由于您使用的是社区模块,因此您可能应该首先向 Ves 支持团队寻求帮助
-
你想用上面的代码实现什么。您是否需要发送编码数据以响应某处?你能跟我说清楚吗
-
@severinolorillajr 我按照您过去链接中的说明操作,并在本页末尾提供 sagar umaretiya 答案。非常感谢。