Re: readfile() memory usage

From: Date: Tue, 01 May 2012 13:39:56 +0000
Subject: Re: readfile() memory usage
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-60389@lists.php.net to get a copy of this message
Hi Larry, > Fascinating.  I even verified the md5sum of the file I got on the other end > just to be sure.  I'll hold off on the blog post then. :-)  I look forward > to your test setup. The server in question is still on PHP 5.2.13 Script: <?php ini_set('memory_limit', '8M'); $name = uniqid() . ".zip"; header('Content-type: application/zip'); header("Content-Disposition: attachment; filename=\"$name\""); readfile('../../filestorage/4f9e9e3b9bcff.zip'); File Information: [user@host public]$ ls -alh ../../filestorage/4f9e9e3b9bcff.zip -rw-r--r-- 1 apache apache 27M Apr 30 10:14 ../../filestorage/4f9e9e3b9bcff..zip Error: [Tue May 01 09:30:48 2012] [error] [client 198.136.162.2] PHP Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 27617281 bytes) in /home/lots/of/path.org/stuff/public/rf822.php on line 6 I'll try something newer, but I wanted to prove myself not crazy and do it on the server in question first. paul

« previous php.internals (#60389) next »