Magento缓存不足报错解决方法 Fatal error: Allowed memory size of 33554432 bytes exhausted

2011-10-27 11:24:00

 

在货品处或者其他部分页面出现了一下几种错误提示:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 30720 bytes) in /home/XXXXX/public_html/lib/Varien/Io/File.php on line 361

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 72897 bytes) in /home/XXXXX/public_html/lib/Varien/Image/Adapter/Gd2.php on line 155

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 122880 bytes) in /home/XXXXX/public_html/lib/Varien/Image/Adapter/Gd2.php on line 332

等。
需要修改根目录下的,php.ini和.htaccess文件里的memory_limit = 64M项,改为memory_limit = 128M.保存后上传覆盖。
在主机空间CP里的PHP Config设置里选择PHP5 (Single php.ini)。

到这个步骤后看看问题是否解决。
如是MAGENTO系统如问题依旧。到Magento后台的缓存设置里勾选缓存选项下的:【设置,布局,区块 HTML 输出,翻译,集合(Collections)数据,EAV 类型与属性以及,网络服务配置选项。】到此问题就应该解决了。

如果你的问题非常的顽固。有的模版还会在页面的最底部出现报错信息。甚至有网页打开报错,或是直接是空白。找到根目录下的 index.php 修改如下:

require_once $mageFilename;

#Varien_Profiler::enable();

#Mage::setIsDeveloperMode(true);

#ini_set(’display_errors’, 1);

ini_set(“memory_limit”,”128M”); <——————————————— 在此加入这一行。

umask(0);
Mage::run();

此时如果没有什么其他“非主流”问题的话。问题解决完毕。

点赞

发表回复

电子邮件地址不会被公开。必填项已用 * 标注