【问题标题】:How can i solve Magento Out of memory Fatal error?如何解决 Magento 内存不足致命错误?
【发布时间】:2016-04-26 10:28:41
【问题描述】:

带有 xampp-win32-7.0.4 的 Magento 1.9.x 随机显示以下类型错误

Fatal error: Out of memory (allocated 14680064) (tried to allocate 790528 bytes) in lib\Less\Parser.php on line 3719
Fatal error: Out of memory (allocated 134217728) (tried to allocate 16384 bytes) in lib\Varien\Image\Adapter\Gd2.php on line 74
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 16384 bytes) in lib\Zend\Db\Statement\Pdo.php on line 228

我尝试以下链接,但没有任何反应

https://indiestechtips.wordpress.com/2012/10/13/magento-fatal-error-out-of-memory-allocated-14680064-tried-to-allocate-1245184-bytes/

【问题讨论】:

  • 好的,但是在 .htaccess 中增加 memory_limit 后分配的内存数量会改变吗?
  • 我投票结束这个问题,因为 Stack Overflow 是一个programming-related 问答网站。您的问题与编程无关。也许你应该把它发到magento.stackexchange.com 上?
  • @Enigmativity ,我实际上没有 magento 或 xampp 或其他问题
  • @matinict - 这是什么意思?

标签: magento xampp out-of-memory


【解决方案1】:

您可以尝试将 Magento 根文件夹 .htaccess 中的内存限制增加到 512。只需找到以下几行并调整 memory_limit 的值:

<IfModule mod_php5.c>

    ############################################
    ## adjust memory limit

    php_value memory_limit 512M

如果您的内存仍然不足,则可能是您的 Magento 安装中存在另一个消耗大量内存的问题。

【讨论】:

    【解决方案2】:

    将此代码添加到 index.php

    ini_set('memory_limit', 256M);
    

    如果问题仍然存在,请增加限制。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-01
      • 2014-01-25
      • 2011-10-16
      • 1970-01-01
      相关资源
      最近更新 更多