問(wèn)題描述
在我的網(wǎng)站中將產(chǎn)品添加到購(gòu)物車時(shí)出現(xiàn)此錯(cuò)誤:
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}
禁用無(wú)關(guān)的插件并沒(méi)有解決問(wèn)題.
Disabled extraneous plugin and that did not solve issue.
標(biāo)題似乎在第 1 行發(fā)送,并嘗試在錯(cuò)誤中引用的文件中再次發(fā)送,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());
}
關(guān)于如何阻止 Magento 在 Mage 之前發(fā)送標(biāo)頭的任何想法?
Any ideas on how to stop Magento from sending headers before Mage does?
推薦答案
可疑模塊被禁用?好吧,那我們?nèi)フ伊硪粋€(gè)答案.首先,檢查在錯(cuò)誤堆棧跟蹤之前是否有任何輸出.輸出會(huì)引發(fā)為此輸出發(fā)送標(biāo)頭.
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.
這篇關(guān)于Magento 錯(cuò)誤:標(biāo)頭已發(fā)送的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!