Imagecreatefromjpeg + memory issue

Hello everybody. I have the following ini variable in phpini file.

max_execution_time 50000

memory_limit 40M

post_max_size 8M

When I try to sketch an image, it causes the following error:

Fatal error: Out of memory (30670848 allocated) (tried to allocate 14976 bytes)

image size is 700 kb.

Can someone help me?

+3
source share
2 answers

Your problem is not that one call to imagecreatefromjpeg (), but that you previously allocated memory. In the end, allocation is not performed with a memory request of only ~ 14 KB.

, script, imagedestroy() . (, webgrind), .

+2

700 ? , .JPG. "" , 10 000 10 000 . / PHP, 10k x 10k x 3 = 286 (10x 3 //).

, , , 40M, 29,25 . , - , , .conf -, , .htaccess, , 40M.

+2

Source: https://habr.com/ru/post/1766547/


All Articles