PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTTP » HTTP_Download » Bug #4304

Apache Process hangs after calling HTTP_Download::send()

Details

Submitted2005-05-08 00:49 UTC
Fromakorthaus at web dot de
Assignedmike
StatusClosed
PackageHTTP_Download
PHP Version5.0.3
OSLinux 2.4.30 (Gentoo)
Roadmaps(Not assigned)

Comments

[2005-05-08 00:49 UTC] akorthaus at web dot de

Description:
------------
I have used HTTP_Download for some time now, but suddenly, after an update to 1.0, I have the following problem:

If I call a script which uses HTTP_Download::send(), the Apache-process needs 100% of available cpu and does not answer anymore, so I have to kill this process.

It does not happen before, it's something in send(). I do not get any error-message (noch php-error, no error_log from Apache...). Apache-Version is 1.3.33, I use PHP as Apache-Module.

I'm sorry but I don't know how to get the exact error.

Reproduce code:
---------------
<?php
require_once 'HTTP/Download.php';
$dl = &new HTTP_Download();
$dl->setFile('./test.txt');
$dl->setContentDisposition(HTTP_DOWNLOAD_ATTACHMENT, 'test.txt');
$dl->send();
?>

[2005-05-30 11:22 UTC] akorthaus at web dot de

The problem only occurs, if I have zlib.output_compression enabled in my php.ini.

I have no "while (@ob_end_clean());" in my 1.0 Code.

I have:

while (ob_get_level()) {
ob_end_clean();
}

if I uncomment it, it seems to work (with zlib.output_compression enabled in my php.ini). OK, as manual says I should not use it with zlib.output_compression, OK. (But bugs which hang up the apache-process when using common php.ini-options are not nice). I think it is an infinite loop.

I often use zlib.output_compression, so what is the recommended way to use PEAR:HTTP_Download here? If I enter

ini_set('zlib.output_compression', '0');

at the beginning of my example-script, it has no effect, the apache process hangs again (if I do not uncomment the loop above).

If I try phpinfo() after ini_set() I get:

Directive Local Value Master Value
zlib.output_compression Off On

I cannot understand it...

[2005-05-30 18:14 UTC] akorthaus at web dot de

I upgraded to 1.1RC1 and it works now! (with zlib.output_compression)

Thanks a lot!

[2005-05-30 18:20 UTC] akorthaus at web dot de

OT: if calling ini_set('zlib.output_comression',0) does not work, is "PHP_INI_ALL" in
http://www.php.net/manual/en/ini.php#ini.list the correct Constant for "zlib.output_comression"?