How can i solve Magento Out of memory Fatal error?

与世无争的帅哥 提交于 2019-12-12 02:53:53

问题


Magento 1.9.x with xampp-win32-7.0.4 showing following type error randomly

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

I try as following link but nothing happen

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


回答1:


You could try to increase the memory limit to 512 in your Magentos root folder .htaccess. Just find the following lines and adjust the value for memory_limit:

<IfModule mod_php5.c>

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

    php_value memory_limit 512M

If you still run out of memory, there might be another problem in your Magento installation that consumes so much.




回答2:


add this code to index.php

ini_set('memory_limit', 256M);

If the problem still comes increase the limit.



来源:https://stackoverflow.com/questions/36862269/how-can-i-solve-magento-out-of-memory-fatal-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!