Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y bytes)

输出图片的函数出错,提示:

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 24000 bytes) in C:\wamp\www\test\picture\post.php on line 14

解决的办法有以下三种:

1 . 修改php.ini(推荐)

memory_limit = 128M

把128M改大点,如512或1024,如果不够继续加。

2 . 在程序里面添加如下语句

ini_set(”memory_limit”, ”128M”);

3 . 添加如下内容

php_value memory_limit 128M
Ps :  如果还不能解决,就把它改得再大一些。

Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y bytes)

https://ldsun.com/2014/01/28/Fatal-error-Allowed-memory-size-of-X-bytes-exhausted-tried-to-allocate-Y-bytes/

Author

Ludis

Posted on

2014-01-28

Updated on

2014-02-21

Licensed under

Comments