imagecreatefromjpeg + Out of memory problem

前端 未结 2 1649
执笔经年
执笔经年 2021-01-21 03:10

Hello All i have following ini variable set in phpini file.

max_execution_time 50000

memory_limit 40M

post_max_size 8M

When i try to make thumbna

2条回答
  •  一向
    一向 (楼主)
    2021-01-21 03:16

    What is the resolution of your 700kb image? It doesn't really matter how big the original .JPG is. If it's a very "simple" image, it could literally be 10,000 x 10,000 pixels. When it's loaded/uncompressed by PHP, those pixels will require 10k x 10k x 3 = 286 megabytes (10x squared times 3 for each red/green/blue component value).

    And of course, you say you've set memory limit to 40M, but you've run out of memory at just 29.25 meg. Could be that there's an override somewhere in the setup, perhaps in a site-specific web server .conf file, or a .htaccess, which is setting a lower limit than 40M.

提交回复
热议问题