开发者

Magento Error: Headers already sent [duplicate]

开发者 https://www.devze.com 2023-01-07 12:20 出处:网络
This question already has answers here: How to fix "Headers already sent" error in PHP (11 answers)
This question already has answers here: How to fix "Headers already sent" error in PHP (11 answers) Closed 9 years ago.

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/pu开发者_运维技巧blic_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}

Edit: Disabled extraneous plugin and that did not solve issue.

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());
}

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


There should be a module settings file in app/etc/modules/ with a boolean in it. Disabling a module output doesn't disable the module. Only its output. Removing the module from the community folder should do the job, but it could be dirty depending on whether this plugin has created tables on your database or not.


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.


GO var/report and find out the problem file.

Check if there is any space before

0

精彩评论

暂无评论...
验证码 换一张
取 消