0

I am aware of a number of posts on this topic - the most comprehensive of which is here.

My particular gremlin looks like this: (without further logging)

2012-04-17T00:28:50+00:00 DEBUG (7): HEADERS ALREADY SENT: <pre>[0] /domains/bodhi.uk.com/subdomains/dev/app/code/core/Mage/Core/Controller/Response/Http.php:51
[1] /domains/bodhi.uk.com/subdomains/dev/lib/Zend/Controller/Response/Abstract.php:766
[2] /domains/bodhi.uk.com/subdomains/dev/app/code/core/Mage/Core/Controller/Response/Http.php:89
[3] /domains/bodhi.uk.com/subdomains/dev/app/code/core/Mage/Core/Controller/Varien/Front.php:188
[4] /domains/bodhi.uk.com/subdomains/dev/app/code/core/Mage/Core/Model/App.php:349
[5] /domains/bodhi.uk.com/subdomains/dev/app/Mage.php:640
[6] /domains/bodhi.uk.com/subdomains/dev/index.php:80

This can occur loading the homepage on dev.bodhi.uk.com

Following the accepted answer in the linked post, creates a list of around 500 files, that are being included - not a practical method for debugging (especially when I may not recognise the issue when looking at it - I am currently assuming that I am looking for whitespace prior to a

For reference the output of the above is here on pastebin

Using the advice in the last comment (that appeared to work for the OP), and adding:

 $headers = array();
foreach ($this->_headers as $i => $header) {
    $headers[$header['name']] = $header;
}
$this->_headers = array_values($headers);
Mage::Log(array_values($headers));

Gives the unexpected responce:

2012-04-17T00:28:50+00:00 DEBUG (7): Array
(
[0] => Array
    (
        [name] => Content-Type
        [value] => text/html; charset=UTF-8
        [replace] => 
    )

)

Ultimately I need to prevent this error, and I am struggling for a next step!

PS: I have also tried Alan's responce in comment 1, however the format of Abstract.php has changed (I am using version 1.6.2), and as I get no further output, I suspect I am not logging things correctly.

Thanks in advance!

Community
  • 1
  • 1

1 Answers1

0

Try ob_start() it may be helpful to you just put this code at the top of your file

Mufaddal
  • 5,398
  • 7
  • 42
  • 57
  • Thanks mufaddal - I have just looked it up and it refers to output buffing ? I guess this could be used to work around an issue with headers, but the core problem would remain, where were you thinking of using it ? – Martin Dean Apr 19 '12 at 10:43
  • 1
    my problem just same as you described when i generate invoice or shipment pdf file this problem occurs so i put ob_start() function in my pdf generation file and my problem was solved. – Mufaddal Apr 20 '12 at 10:03