ID: 45945 User updated by: djimenez at conduit-it dot com Reported By: djimenez at conduit-it dot com -Status: Feedback +Status: Open Bug Type: Apache2 related Operating System: Ubuntu - gutsy gibbon PHP Version: 5.2.6 New Comment:
output buffering was set to Off, though setting it to something else still had the same result with the test on my box. Previous Comments: ------------------------------------------------------------------------ [2008-08-31 00:32:04] [EMAIL PROTECTED] What have you set your output_buffering to? (check from phpinfo() output) ------------------------------------------------------------------------ [2008-08-29 04:15:37] djimenez at conduit-it dot com Description: ------------ Apache2 supports byte range response with an output filter. Static files over 8000 bytes work fine, but mod_php5 served content only works correctly if it is <= 8000 bytes To test I used telnet to submit an HTTP Range request for the included PHP file from an apache2 server configured with mod_php5. Example requests are in the actual results. Reproduce code: --------------- <?php // upto and including 8000 bytes will allow the byterange filter to work // // NOTE: 8000 byte limit was found by manual trial and error, may vary per system, but // my guess would be it has to do with a byte buffer either in mod_php5 or apache2 echo str_repeat(".", 8000); // anything over 8000 bytes will "fail" (full response) //echo "\n...one toke over the line"; ?> Expected result: ---------------- Apache's byterange output filter should handle range requests for PHP responses > 8000 bytes. Actual result: -------------- While the test scripts second echo is commented, I get the expected results: $ telnet dev.conduit-it.com 80 Trying 10.42.84.2... Connected to dev.conduit-it.com. Escape character is '^]'. GET /test.php HTTP/1.1 Host:dev.conduit-it.com Range:bytes=0-24 Connection:close HTTP/1.1 206 Partial Content Date: Fri, 29 Aug 2008 03:43:20 GMT Content-Range: bytes 0-24/8000 Content-Length: 25 Connection: close Content-Type: text/html .........................Connection closed by foreign host. We can also see it working for multiple ranges: $ telnet dev.conduit-it.com 80 Trying 10.42.84.2... Connected to dev.conduit-it.com. Escape character is '^]'. GET /test.php HTTP/1.1 Host:dev.conduit-it.com Range:bytes=0-24,50-74 Connection:close HTTP/1.1 206 Partial Content Date: Fri, 29 Aug 2008 03:45:44 GMT Content-Length: 240 Connection: close Content-Type: multipart/byteranges; boundary=455911696d6f354a2 --455911696d6f354a2 Content-type: text/html Content-range: bytes 0-24/8000 ......................... --455911696d6f354a2 Content-type: text/html Content-range: bytes 50-74/8000 ......................... --455911696d6f354a2-- Connection closed by foreign host. So apache is doing all the work for us, until we uncomment the second echo statement in the repro. script. This puts us over the 8000 byte limit. At that point, both example requests will return full 200 OK responses (so content is 8000 periods + our message) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45945&edit=1