PHP允许的内存大小耗尽但尝试分配的内存更少

问题描述 投票:0回答:1

我用imagecreatefrompng($image)函数得到这个错误:

Got error 'PHP message: PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 61440 bytes) in /var/www/vhosts/SNIPED/httpdocs/app/helper.php on line 115\nPHP message: PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 147456 bytes) in /var/www/vhosts/SNIPED/httpdocs/vendor/composer/ClassLoader.php on line 412

不幸的是我不确定因为61440字节少于允许的1073741824字节。我做错了什么?

php memory upload out-of-memory image-upload
1个回答
1
投票

PHP尝试分配的字节数是增量的:它要求61440字节,当它添加到它已经使用的内存时,超过了允许的内存量。

© www.soinside.com 2019 - 2024. All rights reserved.