Thinkphp 报错Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to alloc

4144

Thinkphp 系统本来是好好的,我的系统的一个分类、更新缓存 突然出现了这个错误,Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 71 bytes) in /data/home/website2/htdocs/core/shop/controller/ctl.gallery.php on line 356


在网上找了一下,都没有看见有相关的解决办法

那么该如何解决Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 71 bytes) in /data/home/website2/htdocs/core/shop/controller/ctl.gallery.php on line 356。


这个错误的意思是 是说,你正在进行的操作需要这么多的内存,但你现在服务器分配的内存不足。

正常情况下,服务器的内存当然是够的,只是你的配置文件需要修改。

解决这个问题的方式:

Thinkphp3.1.3 入口文件

ini_set('memory_limit','32M');这段语句,将其中的数字32改大一些就可以了。比如改为 ini_set('memory_limit','250M');


改完后到后台清除缓存,再看看前台,应该解决了。

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 71 bytes) in /data/home/website2/htdocs/core/shop/controller/ctl.gallery.php on line 356