|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
39 - 13 = ?
Subscribe to this entry?

 [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 16:03:35 2022 UTC