|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2003-03-18 20:22 UTC] sniper@php.net
  [2003-03-24 04:19 UTC] sniper@php.net
 | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 01:00:01 2025 UTC | 
I found this problem trying to serve a binary file. The basic structure of this part of my script is: header('Content-Type: ..'); header('Content-Length: ..'); <output file contents> where <output file contents> would be readfile or similar. However I learned that the first byte of the served file was always a 0x0a (linefeed). I have used telnet to create requests and log responses, and I have found that the response has the following structure: <header><cr><lf> .. <header><cr><lf> <cr><lf> <lf><body-part> i.e. and extra <lf> prepended to the body part of the response. I have tested several different scenarios: * no headers, echo some text * set chunked transfer encoding, do a readfile * set chunked transfer encoding, echo some text * set chunked transfer encoding, use fwrite on php://stdout All methods prepend the linefeed. The telnet dump verify that the headers are set correctly, so this should rule-out the possibility that the linefeed stems from any text before the <? -tag. PHP is build with the following configuration line: './configure' '--with-apache=../apache_1.3.27' '--enable-safe-mode' '--with-mhash' '--enable-xslt' '--with-xslt-sablot' '--enable-sablot-errors-descriptive' '--with-pdflib' '--with-imap=/usr/local/imap' '--with-mcrypt' '--with-pspell' '--with-gettext' '--with-mysql=/usr/local' '--with-pgsql' '--with-gd' '--with-ttf' '--with-t1lib' '--with-png-dir' '--with-zlib-dir=/usr/local/zlib' '--enable-memory-limit' '--with-jpeg-dir' '--with-freetype-dir' '--enable-freetype-4bit-antialias-hack' '--with-tiff-dir' '--enable-exif' '--enable-calendar' I think this problem may be related to #18740.. /David Holdt