Allowed memory size of xxx bytes

来源:互联网 发布:夏茗悠扒皮知乎 编辑:程序博客网 时间:2024/05/21 22:47
经常有的ecshop会出现内存不足用完的情况
 
PHP Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /home1/xxx/public_html/includes/cls_rss.php on line 1590
 
 
PHP Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 24 bytes) in /home1/xxx/public_html/includes/lib_common.php on line 1494 
 
 
,其实有些时候我们可以这样解决:
 方法一:
可以把includes的init.php中的
/* 初始化设置 */
@ini_set('memory_limit',          '64M');
改大一点,就不会出现你这种问题了
可以改成
@ini_set('memory_limit',          '128M');
 
@ini_set('memory_limit',          '256M');
 
@ini_set('memory_limit',          '512M');

方法二:

直接修改php.ini,加大memory_limit的设置


memory_limit = 1024M

重启Apache,搞定