Allowed mem size exhausted
| From: | Shawn McKenzie | Date: | Tue, 05 Aug 2003 15:44:52 +0000 |
| Subject: | Allowed mem size exhausted | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-158305@lists.php.net to get a copy of this message | ||
I have the following code that generates the following error. I am using
this code to prepare a zip or tar.gz file as an email attachment. Can
someone suggest a better / more efficient way to do this and maybe avoid the
error???
I believe that the file that generated this error was about 1.8MB.
6 $fp = fopen($path.$filename, "r");
7 $content = fread($fp, filesize($path.$filename));
8 $attachment = base64_encode($content);
9 $attachment = chunk_split($attachment);
Fatal error: Allowed memory size of 8388608 bytes exhausted at (null):0
(tried to allocate 2228273 bytes) in
/home/user/public_html/dir/subdir/include/functions.php on line 9
Many thanks!
Shawn