繁体   English   中英

SUPEE 6788修补程序Magento之后无法发送标题错误

[英]Cannot sent headers error after SUPEE 6788 patch Magento

我在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的调用方式会导致此错误。 我怎样才能解决这个问题?

提前致谢。

从以上问题中我了解到,您想对数据进行编码并在程序中的某处使用它。

如果以上是正确的,那么您可以尝试以下解决方案。

 $this->getResponse()->clearHeaders()->setHeader('content-type', 'application/json', true); $this->getResponse()->setBody(json_encode($json)); 

谢谢

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM