【发布时间】:2013-01-03 12:09:21
【问题描述】:
我使用 Magento 已经有一段时间了,但最近我感到很沮丧,因为我收到了“允许的内存大小”错误。这通常是通过增加相关 .htaccess 文件中的“php_value memory_limit”来解决的(根据我的理解),自我推出商店之日起,我已将其设置为较高的值。
无论如何,尽管我最近在我的 error_log 中收到以下错误:
PHP Fatal error: Allowed memory size of 52428800 bytes exhausted (tried to allocate 10282 bytes) in /home/store/public_html/includes/src/__default.php on line 2976
PHP Fatal error: Allowed memory size of 52428800 bytes exhausted (tried to allocate 32 bytes) in /home/store/public_html/includes/src/__default.php on line 56485
PHP Fatal error: Allowed memory size of 52428800 bytes exhausted (tried to allocate 77 bytes) in /home/store/public_html/includes/src/__default.php on line 56485
如果有帮助,我将指出以下相关行。 (问题中的行标有** **)
2976:
try {
$includeFilePath = realpath($this->_viewDir . DS . $fileName);
if (strpos($includeFilePath, realpath($this->_viewDir)) === 0 || $this->_getAllowSymlinks()) {
**include $includeFilePath;**
} else {
Mage::log('Not valid template file:'.$fileName, Zend_Log::CRIT, null, null, true);
}
56485:
public function fetchAll($style = null, $col = null)
{
if ($style === null) {
$style = $this->_fetchMode;
}
try {
if ($style == PDO::FETCH_COLUMN) {
if ($col === null) {
$col = 0;
}
return $this->_stmt->fetchAll($style, $col);
} else {
**return $this->_stmt->fetchAll($style);**
}
} catch (PDOException $e) {
#require_once 'Zend/Db/Statement/Exception.php';
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
}
}
我觉得奇怪的是“52428800 字节”,据我了解,它转换为 50MB。这些 50MB 可以在哪里预定义?我清楚地检查了我的 php 信息,但该值无处可见,“php_value memory_limit”也与我之前定义的相对应,并且远不及 50MB。
我的 Magento 设置:
- Magento 1.5.10
- 已启用内存缓存
- 编译已启用
硬件设置:
- 具有 12GB RAM 的 VPS
- WHM / cPanel
- NginxCP
当前 PHP 配置:
- 默认 PHP 版本(.php 文件)5
- PHP 5 处理程序 dso
- PHP 4 处理程序无
- Apache suEXEC 开启
- Apache Ruid2 开启
如果有人能够为我指出如何解决此问题的正确方向,我将非常感激。谢谢。
【问题讨论】:
标签: php magento magento-1.5