Open
Description
Description
This issue is problematic only when zlib.output_compression
is enabled.
Currently, when zlib.output_compression
is enabled like:
php -S 127.0.0.1:81 -d zlib.output_compression=1 -t .
(but also tested if enabled when used /w Apache /wo mod_deflate)
and ob_end_flush()
is called, no headers cannot be send anymore even if the nothing was output.
Currently, we had to use the following code
while (ob_get_level() > 0) {
if (ob_get_length() === 0) {
ob_end_clean();
} else {
ob_end_flush();
}
}
to workaround.
When zlib.output_compression
is NOT enabled, the following code:
while (ob_get_level() > 0) {
ob_end_flush();
}
is working (allows to send additional headers).
Because of this inconsistency, I belive php gzip output handler behaviour should be fixed, when output buffer is empty, to not flush implicitly.
PHP Version
any
Operating System
any