Error while uploading an Image

Support for coding, modules or other software issues
Post Reply
Beachgirl
Posts: 51
Joined: Wed Oct 20, 2010 4:57 pm
Location: USA

Error while uploading an Image

Post by Beachgirl » Thu Nov 04, 2010 7:55 am

While uploading an image using admin I received this error:

Code: Select all

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 12288 bytes) in /home/p164h3jq/public_html/library/image/image.php on line 85

Code: Select all

  line 85:      		$source = imagecreatefromjpeg(DIR_IMAGE . $image);
The image I was uploading was only around 100 kb and if I mistakenly grabbed the wrong image that one would have been 2.5mb.
I googled the error and most fixes suggested that the memory_limit needed to be changed in th php.ini file.
I do not have this file and or don't have access to it through my hosting server after calling them to find out.
They suggested that I create my own php.ini file and put it into the folder where the error is happening and move backwards from there by placing the same file in every folder leading up to it.
I made the file with only this line "memory_limit = 32M;" (tried 64M as well) I did this and of course the error is still there.

The entire image section in admin is now down. However, I am still able to upload images through my ftp and add them to products.

User avatar
Brent
Site Admin
Posts: 4459
Joined: Sat Dec 12, 2009 3:35 pm
Location: Canada eh

Re: Error while uploading an Image

Post by Brent » Thu Nov 04, 2010 8:51 am

Just to test, add this in common.php right under //REPORT ALL ERRORS.
It will tell you what they have memory limit set at.

Code: Select all

echo ini_get('memory_limit');


Then add this just above that line.

Code: Select all

ini_set('memory_limit', '64M');
See if that fixes your problem and let us know the results.

Beachgirl
Posts: 51
Joined: Wed Oct 20, 2010 4:57 pm
Location: USA

Re: Error while uploading an Image

Post by Beachgirl » Thu Nov 04, 2010 12:50 pm

Yes, problem fixed! Thank you so much Brent :P

Post Reply