ID: 42362 Updated by: scott...@php.net Reported By: ob dot php at daevel dot net -Status: Open +Status: Closed Bug Type: Feature/Change Request Operating System: Debian Etch PHP Version: 5.2.8 New Comment:
This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Will be fixed in 5.3 and may be backported to 5.2 Previous Comments: ------------------------------------------------------------------------ [2009-02-17 19:52:12] ezy...@php.net I'm reopening this bug, under the contention that while PHP is not strictly at fault, it would be nice if it "did the right thing" when it noticed that output was empty, if only because gzipping nothing increases the size, not decrease it! Either that, or this is a documentation bug, in which case header() and/or zlib.output_compression should warn users that any HTTP status codes which are required to return no output must have zlib.output_compression turned off. ------------------------------------------------------------------------ [2007-09-05 17:38:39] m...@php.net Well, the key issue is, zlib.output_compression and ob_gzhandler are not the same thing. Enabling zlib.output_compression starts the output handler without regard whether there's output or not unless you disable it again without sending output. ob_gzhandler is only initialized if there's been output. ------------------------------------------------------------------------ [2007-09-05 14:30:02] ob dot php at daevel dot net Yes of course if I disable the compression (with ini_set), there is not the problem. But is it really to the script to check and correct an internal behavior ? An old script which use ob_start( 'gz_handler' ) doesn't meet this "bug". ------------------------------------------------------------------------ [2007-09-04 12:33:58] j...@php.net AFAICT, you're sending the 304 in your script, it's not done by PHP. So in that case, isn't it your script that should turn off the compression? ------------------------------------------------------------------------ [2007-09-04 07:04:34] ob dot php at daevel dot net The RFC say : "The 304 response MUST NOT contain a message-body, and thus is always terminated by the first empty line after the header fields." Source : http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html (cf 10.3.5 "304 Not Modified" ) Actually PHP sent the "GZIP Magic Header" (I'm not talking about the HTTP headers, but the start of a gzip compressed data). ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/42362 -- Edit this bug report at http://bugs.php.net/?id=42362&edit=1