4

Possible Duplicate:
How to fix “Headers already sent” error in PHP

[Mon Jan 10 21:01:26 2011] [error] [client xx.xx.xxx.xx] PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0, referer: www.example.com/some.php

Why PHP is not able to locate where the headers were sent from?

Community
  • 1
  • 1
Sarah
  • 281
  • 3
  • 7
  • 13
  • Are you echoingsomething above header? Remove the whole blankspave on the top of the page ans put – zod Jan 10 '11 at 21:17
  • 2
    Try googling it. There's tons of information out there on this. – ircmaxell Jan 10 '11 at 21:17
  • 3
    Everyone tries to help ts with "headers already sent" problem, but he only needs to know what does "Unknown" stands for... – Mironor Jan 10 '11 at 21:23
  • @ircmaxell but I don't see anything usable. Note the `Unknown on line 0` – Pekka Jan 10 '11 at 21:23
  • @Pekka: The other discussion linked above seems to identify the cause of the problem. http://bugs.php.net/bug.php?id=9031 – nico Jan 10 '11 at 21:29
  • @nico: from the PHP bugs page: "[2001-06-14 12:49 UTC] Problem has already been solved in php 4.0.5.", however I'm using the latest version. Notice, that it appeared somewhere in 2001, 9 years ago. There must be other reason. – Sarah Jan 10 '11 at 21:56
  • @Sarah: are you using `ob_start("ob_gzhandler");`? Anyway, the problem seemed to be due to a memory leak, so I would try to find the culprit and file a bug report. – nico Jan 10 '11 at 21:58
  • 2
    @Sarah - how are they not the same? Same error message, with the same "I have no clue what this means" question text. See also: http://blog.stackoverflow.com/2011/01/the-wikipedia-of-long-tail-programming-questions/ – ken Jan 10 '11 at 22:11
  • @ken Dont you find it strange, that php does not know where the headers are modified? Edited: ok, as I understood, it's because of ob_start() function.. – Mironor Jan 10 '11 at 23:20

1 Answers1

-1

See if you have a space after <?. The header function is quite sensitive and doesnt work if anything is outputted before hand.

NoviceCoding
  • 6,145
  • 2
  • 27
  • 33