#29801 [Opn->Csd]: Using readfile() to send large files causes PHP to hang
| From: | iliaa@php.net | Date: | Mon, 15 Nov 2004 23:55:24 +0000 |
| Subject: | #29801 [Opn->Csd]: Using readfile() to send large files causes PHP to hang | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-69115@lists.php.net to get a copy of this message | ||
ID: 29801
Updated by: iliaa@php.net
Reported By: WPinegar at healthtech dot net
-Status: Open
+Status: Closed
Bug Type: Reproducible crash
Operating System: Windows Server 2003
PHP Version: 5.0.1
New Comment:
This bug has been fixed in CVS.
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/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2004-09-13 13:43:19] thomas at mbox371 dot swipnet dot se
the problem exists in php 4.3.8 as well.
------------------------------------------------------------------------
[2004-08-24 20:14:31] thomas at mbox371 dot swipnet dot se
latest apache2, Windows 2000 server, php 5.0.0/5.0.1/5.0.2-cvs.. same
problem with all these configurations. When streaming files > 5mb thru
php there is timeouts. Also, it seems not to work to stream these files
over a slower connections (0.5mbit) at all (stops after a few seconds)
when it works better on a 100mbit lan.
------------------------------------------------------------------------
[2004-08-23 19:47:40] WPinegar at healthtech dot net
Description:
------------
Attempting to use readfile() to send large (over 250MB) binary objects
causes PHP 5.0.1 to hang or the web server to send a 302 error.
Reverting back to PHP 4.3.8 resolves the issue.
Using fopen() and fpassthru() only makes the issue worse.
We are using IIS 6 and the PHP ISAPI script engine.
Reproduce code:
---------------
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header("Content-Disposition: attachment;
filename=".basename($filename).";");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($filename));
readfile("$filename");
exit();
Expected result:
----------------
PHP 5 has an issue with sending large binary files. This should be
resolved.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29801&edit=1