私はかなり長い間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);
}
}
ここで奇妙に思えるのは、私の理解では 50MB に変換される「52428800 バイト」です。これらの 50MB はどこで事前定義できますか? 私は自分のphp情報を明確にチェックしましたが、値はどこにも見られません。また、「php_value memory_limit」は以前に定義したものに対応しており、50MBに近くありません。
私のマジェントのセットアップ:
- マジェント 1.5.10
- Memcache が有効
- コンパイル可能
ハードウェアのセットアップ:
- 12GB RAMのVPS
- WHM / cPanel
- NginxCP
現在の PHP 構成:
- デフォルトの PHP バージョン (.php ファイル) 5
- PHP 5 ハンドラー dso
- PHP 4 ハンドラー なし
- Apache suEXEC オン
- Apache Ruid2 オン
この問題を解決する方法について誰かが正しい方向に向けることができれば、本当に感謝しています. ありがとうございました。