问题:当客户登录并将产品保存在管理面板中时,然后刷新前端并显示错误:
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 88 bytes) in /home/staging/public/kralengroothandel/app/code/local/Zend/Db/Statement/Pdo.php on line 297
或者
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 83 bytes) in /home/staging/public/kralengroothandel/lib/Varien/Simplexml/Element.php on line 196
Pdo.php 行,出现问题的地方:
public function _execute(array $params = null)
{
try {
if ($params !== null) {
return $this->_stmt->execute($params);
} else {
return $this->_stmt->execute();
}
第二个地方:
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);
}
元素.php:
if (!$desc) {
return false;
}
我在本地机器上有相同的代码和数据库,但我没有这个问题。
memory_limit 设置在 512M 上,我想问题不在这里,因为 Zend_Db 库设置了内部内存限制。所以我尝试放入ini_set('memory_limit', '1024M');
Pdo.php,但它也无济于事。我有 OneStepCheckout 扩展(也许这是我遇到这个问题的原因)。我使用 Ngnix。也许有人有同样的错误?
我的服务器上的 php-fpm.conf:
pm = dynamic
pm.max_children = 4
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 2
request_terminate_timeout = 0
request_slowlog_timeout = 0
chdir = /
php_admin_value[memory_limit] = 512M
php_admin_value[post_max_size] = 128M
php_admin_value[post_max_vars] = 64000
php_admin_value[max_execution_time] = 3600
php_admin_value[realpath_cache_size] = 16m