RE: [PHP] Output Buffering and zlib Compression Issue
| From: | Jan Reiter | Date: | Sat, 04 Aug 2007 04:09:12 +0000 |
| Subject: | RE: [PHP] Output Buffering and zlib Compression Issue | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-260170@lists.php.net to get a copy of this message | ||
Right!
With zlib compression ob_start() or similar seems to get called before the
user
script execution. I'm not quite sure why. Anyhow ob_get_level() returns 2
after
the ob_start() is called for the first time in the script. You can avoid the
error
with
while (ob_get_level() > 1) {
ob_end_clean();
}
but it won't kill the buffer containing output before ob_start() is called.
ob_end_clean();
ob_end_clean();
will reproduce your error, too. This leads to the assumption, that it is an
issue
of advancing the functions internal process pointer.
Same reason why
$data1 = mysql_fetch_assoc($resultid);
$data2 = mysql_fetch_assoc($resultid);
won't lead to the desired effect either, but
While($data = mysql_fetch_assoc($resultid)){...}
does, as does
while (@ob_end_clean());
It seems only this way of accessing the buffers allows deleting the
lowermost buffer created before
Script execution.
Jan
-----Original Message-----
From: Chris [mailto:chris@dented-planet.net]
Sent: Saturday, August 04, 2007 3:25 AM
To: php-general@lists.php.net
Subject: [PHP] Re: Output Buffering and zlib Compression Issue