0

我们已将 nginx 用户设置为每隔 5 分钟运行一次以下命令。

sh /var/www/magento/cron.sh

这在一段时间内相当成功地执行了。最近一个月左右,由于内存限制,每次都开始出错。我增加了内存限制,但这只会导致达到更高的限制。看来一定有更大的问题。错误始终如下。

Fatal error: Allowed memory size of 262144 bytes exhausted 
(tried to allocate 7680 bytes) in /var/www/magento/app/Mage.php on line 589

以下是 magento 设置为每五分钟运行一次的 crons:

job: xmlconnect_notification_send_all   
model: xmlconnect/observer::scheduledSend   
file: /var/www/magento/app/code/core/Mage/XmlConnect/etc/config.xml

job: newsletter_send_all    
model: newsletter/observer::scheduledSend   
file: /var/www/magento/app/code/core/Mage/Newsletter/etc/config.xml

job: enterprise_staging_automates
model: enterprise_staging/observer::automates   
file: /var/www/magento/app/code/core/Enterprise/Staging/etc/config.xml
4

2 回答 2

1

你的错误信息有所有的答案

允许的内存大小 262144 字节已用尽

虽然 262144 字节似乎是一个很大的数字,但它只有256KB或大约0.25 MB

我相信 Magento 文档建议的内存限制为 256MB,而 512MB 在野外更为常见。您需要确保您的命令 PHP 版本(或由 启动的命令行 PHP cron.sh)的memory_limit ini设置正确。这里的一个常见陷阱是省略M, 或使用MB

; Will not do what you want it to
memory_limit=256
memory_limit=256MB

因此,请确保您的配置文件设置如下

memory_limit=256M
于 2013-11-15T04:36:06.843 回答
0

这是服务器设置问题。您的 php CLI memory_limit 设置得太低。

反弹到 256M。

如果您没有运行自己的服务器,则需要联系您的托管服务提供商。

于 2013-11-15T03:35:44.130 回答