demonstration of PHP 5.04 readfile() bug

PHP 5.0.4 appears to have a bug in which the readfile() function will truncate files at about 1.9MB. This has already been reported to the PHP project as bugs 33458 and 32553, and the issue was reportedly fixed in subsequent versions of PHP 5. Both bug reports specifically mention Windows XP, but this issue is occurring on Dreamhost's Debian Linux servers.

Click on the link below to see a demonstration of this issue. The complete file should be ~4MB, but only ~1.9MB will be downloaded.

link to ~4MB quicktime movie (size: 4305473 bytes)

This link executes the following PHP code:

<?php
$file = "Tom_Cruise_Kills_Oprah.mov";
header("Content-Type: video/quicktime");
header('Content-Disposition: attachment; filename="' . $file . '"');
header("Content-Length: " . filesize($file));
readfile($file);
?>

direct link to quicktime movie, for comparison purposes

(Current PHP version: 5.2.17)