php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61820 using ob_gzhandler will complain about headers already sent when no compression
Submitted: 2012-04-23 00:19 UTC Modified: 2012-04-24 17:56 UTC
From: [email protected] Assigned: mike (profile)
Status: Closed Package: Zlib related
PHP Version: 5.4.0 OS: Linux
Private report: No CVE-ID: None
 [2012-04-23 00:19 UTC] [email protected]
Description:
------------
When using ob_gzhandler with PHP 5.4.0+, PHP will emit warnings after flushing 
more than once (it looks like it's trying to modify headers on each flush).

This problem didn't exist in PHP 5.3.


Test script:
---------------
<?php

ob_start('ob_gzhandler');

echo "PHP VERSION ".phpversion()."\n";
ob_flush();
flush();

echo "This is confusing:\n";
ob_flush();
flush();


Expected result:
----------------
PHP VERSION 5.5.0-dev
This is confusing:

Actual result:
--------------
PHP VERSION 5.5.0-dev
This is confusing:

Warning: Cannot modify header information - headers already sent by (output 
started at php-src/moo.php:6) in php-src/moo.php on line 10


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-04-23 09:01 UTC] [email protected]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: mike
 [2012-04-24 17:56 UTC] [email protected]
-Status: Assigned +Status: Closed
 [2012-04-24 17:56 UTC] [email protected]
This bug has been fixed in SVN.

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/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Dec 31 04:00:01 2025 UTC