View Full Version : Allowed memory size error with GD2
November 7th, 2007, 04:58 AM
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 13824 bytes) in /home/zclutnet/public_html/gallery/image-inc.php on line 84
I've been getting this from several users, and now myself.
I have cleared out the uploads directory, my server has plenty of space, and at the top of my pp-inc.php file I added
error_reporting (E_ALL ^ E_NOTICE);
Which is working as the 32M is referenced in my error. I'm using GD2, I don't have ImageMagik :(
Any ideas please?
November 7th, 2007, 07:38 AM
Have you tried uploading smaller files? Have you tried setting 40M as the memory in that line. Basically lets see how big a file your server can handle before GD2 cuts things out.
November 8th, 2007, 04:51 AM
Fatal error: Allowed memory size of 50331648 bytes exhausted (tried to allocate 8192 bytes) in /home/zclutnet/public_html/gallery/image-inc.php on line 115
That was with 48m set. I don't understand that it used to run fine with big images before. The image I'm trying to upload is 4mb, that failed.
I just resized it to 1.5mb, that worked,
then 3.2mb, that worked.
So around 4mb kills it with 48mb memory allocated :)
Is there any way around this, other than allocating say 128mb memory? I'm on shared hosting so don't want to push my luck for now.
At least most of the photos my users upload won't fail now.
November 8th, 2007, 06:31 AM
No not with GD2 it is a common issue with PHP as it is part of PHP and uses PHP memory. Thats a huge file. I would suggest you compile Imagemagick on your server which is not prone to that type of error since it is not part of PHP.
November 8th, 2007, 07:47 AM
Yeah again shared hosting, not sure I'm allowed to, I'll check it out though thank you.
4mb really isn't that big these days... :)
November 8th, 2007, 09:49 AM
It may not be big nowadays but it doesnt mean your still not limited to server restrictions and image processor restrictions. GD2 is part of PHP and since it uses PHP's memory if it encounters a big file where it uses up the memory of PHP your servers PHP shuts down and this is what you encounter. You can only give more memory to PHP or limit filesizes in Admin => Edit Usergroups.
vBulletin® v3.8.1, Copyright ©2000-2014, Jelsoft Enterprises Ltd.