|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40437 decompress.bzip2 is broken
Submitted: 2007-02-11 21:05 UTC Modified: 2008-11-10 01:00 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: phpbugger dot 5 dot n1 at spamgourmet dot com Assigned: tony2001 (profile)
Status: No Feedback Package: Bzip2 Related
PHP Version: 5.2.1 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: phpbugger dot 5 dot n1 at spamgourmet dot com
New email:
PHP Version: OS:


 [2007-02-11 21:05 UTC] phpbugger dot 5 dot n1 at spamgourmet dot com
(See example code) - when using the bzip2.decompress filter on a http://-stream, php uses a lot of CPU resources and hangs. Decompressing with bzdecompress works, however, as does using zlib.decompress filters on .gz files via HTTP.

Reproduce code:

$url = '';
$url = '';

/* this works: */
$data = bzdecompress(file_get_contents($url));
echo "bzdecompress is finished!\n";

/* however, file_get_contents will block while PHP uses a lot of CPU time */
$fp = fopen($url,'rb');
stream_filter_append($fp, 'bzip2.decompress');
echo "stream_get_contents is finished!\n"



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-11 21:36 UTC] mark at mlstuff dot co dot uk
Using the read/write parameter STREAM_FILTER_READ seems to fix this.

stream_filter_append($fp, 'bzip2.decompress', STREAM_FILTER_READ);
 [2008-11-02 12:40 UTC]
Please try using this CVS snapshot:
For Windows:

 [2008-11-10 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Jan 22 14:03:39 2022 UTC