RE: [PHP] handling large files w/readfile

From: Date: Sun, 02 Jan 2005 08:43:06 +0000
Subject: RE: [PHP] handling large files w/readfile
Groups: php.general 
Request: Send a blank email to php-general+get-205469@lists.php.net to get a copy of this message
Rasmus Lerdorf wrote:
============================ $buff = "0"; while (!feof($fp)) { $buff = fread($fp, 4096); print $buff; } unset($buff); fclose ($fp); ============================
Well, the above code does not use more than 4K of ram plus a bit of overhead. So if something is causing your processes to grow to 450M you need to look elsewhere because this code is definitely not the cause.
Well, the test case is: 1) above with big files = big apache processes - machine crashes 2) download big files with:
     Header("Location: ".$html_pointer_to_file);
= small apache processes - works great So, I don't know if it can be anything else but that - so I am open to suggestions, or tests that anyone wants me to run. -Robin

« previous php.general (#205469) next »