ShopEx点击菜单,提示内存溢出

今天用户点击左侧菜单“家用电器”后,弹出如下错误提示:


系统暂时发生错误,请回到首页重新访问


Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 192269 bytes) in /www/b2c/core/include/shopPage.php on line 203

<{t}>查看所有错误<{/t}>

<br />
<b>Fatal error</b>:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 192269 bytes) in <b>/www/b2c/core/include/shopPage.php</b> on line <b>203</b><br />


因为是新手,我先查看了服务器的内存使用情况:

[root@orange3c ~]# free -l
             total       used       free     shared    buffers     cached
Mem:      16429380    6082864   10346516          0     123724    4647224
Low:      16429380    6082864   10346516
High:            0          0          0
-/+ buffers/cache:    1311916   15117464
Swap:     18481144          0   18481144

还有10G的free空闲。

然后检查nginx,mysql的配置文件,感觉没有问题。

继续看php的配置文件。

先找到/usr/local/Zend/etc/php.ini 文件,里头的memory_limit = 128M,应该没什么问题。

后来在网上搜索到http://bbs.shopex.cn/read.php?tid-152039.html,也发现这个分类下的商品很多,我就打开/www/b2c/config/config.php文件,确实发现

@ini_set('memory_limit','32M');

后改成

@ini_set('memory_limit','256M');

返回网站页面,能正常显示了。

原文地址:https://www.cnblogs.com/benio/p/1783853.html