PHP troubles - a few bytes before the main server response

Published on June 22, 2008

PHP troubles - a few bytes before the main server response

    Today I ran into a serious problem: Apache assigns 3-4 extra bytes in front of the response body, which, at first glance, carry no meaning.
    For html-content this does not present a problem - everything is rendered as it should, but for a more sensitive xml there was a problem: the reading script gets confused in the encoding (((

    The first thought - about unicode BOM - was not confirmed. A file encoded in windows-1251 is rendered in the same way.
    Non-php files - tried txt, xml - given without problems.
    I suspect that this may be in the configuration of the web server, but I don’t know where to dig.
    I really hope for the help of the collective mind.

    Thank you very much in advance!

    UPD:
    Here the problem can be seen more clearly: for93t.users.ru/demo/3bytes.html

    SOLUTION:
    Sea of ​​gratitude to the esteemed don p0is0n !
    The problem was resolved by adding an additional Content-Length header with the correct value.