GD and Memory Allocation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

GD and Memory Allocation

Post by neophyte »

While resizing images I got this error:
Fatal error: Allowed memory size of 13651808 bytes exhausted (tried to allocate 8192 bytes)
Is this a limitation of GD? php.ini memory allocation? What can be done to avoid this?
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

This worked...

Code: Select all

ini_set("memory_limit","24M");
User avatar
Buddha443556
Forum Regular
Posts: 873
Joined: Fri Mar 19, 2004 1:51 pm

Post by Buddha443556 »

Darn my slow typing!!
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

:lol: :lol:

Been there...

:lol: :lol:

Thanks anyway!
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

I usually set the memory limit to 0 in development, especially since the project I'm working on now has a lot of image-resizing all done in GD, I also got the maximum execution time set to unlimited so I can traverse directories thumb-nailing 100's of thousands of photos at a time.
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

Serious? 100's of thousands? Wow!
Post Reply