|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21228 output handler 'ob_gzhandler' cannot be used twice
Submitted: 2002-12-27 19:40 UTC Modified: 2004-02-25 03:28 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: mlaukast1 at hotmail dot com Assigned: iliaa (profile)
Status: Closed Package: Output Control
PHP Version: 4.3.0/4.4.0-dev OS: All
Private report: No CVE-ID: None
 [2002-12-27 19:40 UTC] mlaukast1 at hotmail dot com
If I use ob_start("ob_gzhandler") function I get an error message: "PHP Warning:  ob_gzhandler() [<a href=''>ref.outcontrol</a>]: output handler 'ob_gzhandler' cannot be used twice in c:\web\test.php3 on line 11". The same script runs fine on 4.2.3. Interestingly, on version 4.3.0 ob_get_level() returns 2 and on 4.2.3 the return value is 1. I'm using Windows 2000 Server/IIS5. PHP is configured in CGI mode.

Here's the script:
<h3>This is a test. ob_get_level: <% echo ob_get_level(); %></h3>

And here's the essential configurations from the 'php.ini' file:

output_buffering = 4096
output_handler =
zlib.output_compression = Off
implicit_flush = Off
allow_call_time_pass_reference = Off

If I set "output_handler = ob_gzhandler" and remove the ob_start("ob_gzhandler") from the script it's working on 4.3.0 as well. However, this way the compression is always on and I can't determine myself when to use it.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-28 13:15 UTC] chris at de-punkt dot de
The error occurs on Linux, too. A customer reported it and it can nicely be reproduced with 


which yields the warning visible under

Environment is
 [2002-12-30 13:41 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

 [2004-02-25 02:13 UTC] ricko at garagegames dot com
Reproduced this bug in v4.3.5rc3 on Apache/Win32 with php beling loded as a module.


Warning: (null)() [ref.outcontrol]: output handler 'ob_gzhandler' cannot be used twice in Unknown on line 0
 [2004-02-25 03:28 UTC]
Have you check the ini? It must contain the following two settings:

output_handler =
zlib.output_compression = Off
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 08:01:31 2024 UTC