|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-09-30 09:56 UTC] scottmacvicar at ntlworld dot com
Description:
------------
Calling flush in Apache and Apache 2 produce different results.
Within Apache after calling flush you can still send headers as the output buffer prevents it from actually being flushed.
Within Apache 2 after calling flush you can no longer send headers even though headers_sent still returns false.
Reproduce code:
---------------
<?php
ob_start();
echo 'test';
flush();
$newtext = ob_get_clean();
if (strpos(' ' . $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false AND !headers_sent())
{
header('Content-Encoding: gzip');
$newtext = gzencode($newtext, 1);
}
header('Content-Length: ' . strlen($newtext));
echo $newtext;
?>
Expected result:
----------------
test
Actual result:
--------------
binary data
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 20:00:01 2025 UTC |
<?php ob_start(); echo 'test'; flush(); $newtext = ob_get_clean(); if (!headers_sent()) { echo 'in here<br />'; } echo $newtext; ?> Based on what you've said above then you shouldn't see 'in here' within Apache 2.