Re: Memory Allocation Error
| From: | heavyccasey at gmail dot com | Date: | Tue, 06 Nov 2007 15:18:58 +0000 |
| Subject: | Re: Memory Allocation Error | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-264111@lists.php.net to get a copy of this message | ||
Thank you! That works.
On Nov 6, 2007 12:23 AM, Per Jessen <per@computer.org> wrote:
>
> heavyccasey@gmail.com wrote:
>
> > Hi!
> >
> > I have a script that reads a 120 MB remote file. This raises a Memory
> > Allocation Error unless I use:
> > ini_set('memory_limit', '130M');
> >
> > I doubt this is good for my server... I tried both fopen and
> > file_get_contents. This used to work fine in PHP 4 until I upgraded to
> > PHP 5.
> >
> > Any ideas?
>
> If you need to keep a 120Mb file in core at any point in time, you'll
> need the memory. Either adjust the memory-limit, or change your code
> to process the file in chunks/lines/bytes.
>
>
> /Per Jessen, Zürich
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>