Re: Out of Memory error
| From: | Robert Cummings | Date: | Thu, 23 Aug 2007 15:42:44 +0000 |
| Subject: | Re: Out of Memory error | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-261174@lists.php.net to get a copy of this message | ||
Check the filesize before you attempt to load it. For uploads you can
set maximum allowed uploads... can't remember if that is sufficient to
catch the problem before it becomes a fatal error.
Cheers,
Rob.
On Thu, 2007-08-23 at 17:35 +0200, Wouter van Vliet / Interpotential
wrote:
> I've got a followup question to this. Whenever you're doing something that
> takes too much memory, having a file uploaded that's bigger than max upload
> size (actually, not sure if that applies but I think it does) or when your
> script is taking too long to execute it just dies with a very unfriendly
> error.
>
> Is there any way to catch these errors, stop the script in some other way
> just before it ends so we can provide some reasonable feedback to the user?
>
> On 23/08/07, Robert Cummings <robert@interjinn.com> wrote:
> >
> > On Fri, 2007-08-24 at 01:21 +1000, Naz Gassiep wrote:
> > > I'm getting out of memory errors in my image handling script, I *think*
> > > its because I'm handling images that are too large to fit in memory, but
> > > I thought I'd check before just upping the setting to 32mb.
> > >
> > > It is currently set to 16mb and I am working with a 2048x1536 image. Is
> > > it possible that the image is what is causing the scrip to OOM?
> >
> > Very likely.
--
...........................................................
SwarmBuy.com - http://www.swarmbuy.com
Leveraging the buying power of the masses!
...........................................................