View Full Version : allowed memory size # exhausted

05-14-2004, 07:22 AM
In my php upload script if i upload a file larger than x; then i get this error

Fatal error: Allowed memory size of 8388608 bytes exhausted at (null):0 (tried to allocate 1600 bytes) in /var/www/html/images/screenshots/addfile.php on line 53

on line 53 in that file i have this:


it works with small files; i dunno if theres a variable in the php.ini that i need to make larger or something related to apache?


05-14-2004, 07:48 AM
ok i found out why; in my php.ini the memory size limit is set at 8 mg

and after reading here http://www.kirupaforum.com/forums/showthread.php?t=55050 i can see why my 300kb files are exceeding the 8 mg memory limit

but i still havent figured out how to get around it being that i dont think my host will change that value

my host does support gd2; i dunno if i did something with that if it would take less memory

05-15-2004, 04:49 PM
The GD libraries, when working on a jpeg have to decompile the compressed data to what is tantamount to a 6bytes per pixel string (the basic .gd file format - which it may then compress to .gd2 if needed).
As every pixel is stored in phps memory there is an upper limit on the size of files that can be worked with.

Unfortunately GD cannot as yet process from a designated part of a jpeg image.

If your host has ImageMagick installed, you could try that - it wouldn't have the issues that GD has as it runs from command line calls. Either that or try some script-fu calls to the-gimp if they have that accessible.