Magento错误:标头已发送 [英] Magento Error: Headers already sent

查看:76
本文介绍了Magento错误:标头已发送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将产品添加到我的网站中的购物车时出现此错误:

I got this error while adding products to the cart in my site:

Cannot send headers; headers already sent in /home/website/public_html/app/code/local/Perpetual/MultiAdd/controllers/Checkout/CartController.php, line 153
Trace:
#0 /home/website/public_html/lib/Zend/Controller/Response/Abstract.php(147):      Zend_Controller_Response_Abstract->canSendHeaders(true)
#1 /home/website/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(585): Zend_Controller_Response_Abstract->setRedirect('http://www.trum...')
#2 /home/website/public_html/app/code/core/Mage/Checkout/controllers/CartController.php(85): Mage_Core_Controller_Varien_Action->_redirect('checkout/cart')
#3 /home/website/public_html/app/code/local/Perpetual/MultiAdd/controllers/Checkout/CartController.php(203): Mage_Checkout_CartController->_goBack()
#4 /home/website/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(376): Perpetual_MultiAdd_Checkout_CartController->addmultipleAction()
#5 /home/website/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(248): Mage_Core_Controller_Varien_Action->dispatch('addmultiple')
#6 /home/website/public_html/app/Mage.php(459): Mage_Core_Controller_Varien_Front->dispatch()
#7 /home/website/public_html/wholesale/index.php(65): Mage::run('wholesale', 'website')
#8 {main}

禁用无关的插件,但不能解决问题.

Disabled extraneous plugin and that did not solve issue.

似乎标头在第1行中发送,并尝试再次在错误CartController.php-

It appears that headers are sent in line #1 and attempted to be sent again in the file referenced in the error, CartController.php -

$url = $this->_getSession()->getRedirectUrl(true)
if ($url) {
    $this->getResponse()->setRedirect($url);
} else {
$this->_redirectReferer(Mage::helper('checkout/cart')->getCartUrl());
}

关于如何在Mage之前阻止Magento发送标头的任何想法?

Any ideas on how to stop Magento from sending headers before Mage does?

推荐答案

可疑模块已禁用? 好的,那我们再去回答. 首先,检查在错误堆栈跟踪之前是否获得任何输出.输出会触发发送此输出的标头.

Suspicious module disabled? Ok, let's go for another answer then. First, check whether you get any output before the error stack trace. An output provokes the sending of headers for this output.

这篇关于Magento错误:标头已发送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆