When changing settings in a product I get the message:

Memory limit has been reached magento-2

Why is that and what causes this? Is it a problem in the version 2.0.9 I have running? Or is it because of the php settings which are not suitable? How to solve this? Any hints?

  • Increase memory_limit in Apache php.ini & restart Apache. Then check again
    – Jackson
    Oct 5, 2016 at 9:11
  • The problem is that it is on a hosted environment. So unfortunately I can not edit php.ini and restart apache
    – mr_typo3
    Oct 5, 2016 at 9:15
  • 1
    Then you can ask host provider to change the settings. Oct 5, 2016 at 9:18
  • magento2\.htaccess Update php_value memory_limit 768M & php_value max_execution_time 18000
    – Jackson
    Oct 5, 2016 at 9:22
  • this is already in the .htaccess but seems not to work. So I ask the provider to act on this.
    – mr_typo3
    Oct 5, 2016 at 9:44

3 Answers 3


I would recommend changing the memory_limit setting in the php.ini file (root folder of your project)


The cause is because PHP has exhausted the maximum memory limit as set by the configuration value memory_limit.

Go to php.ini file, increase memory_limit and restart Apache.


Goto your Magento root folder and


In this file go to __construct method you will find memory_limit and you can change another php related settings from here.

But this is a core file and its not good to change the core file. Whenever you upgrade Magento the change will loose.

  • Had a look at that file but I think its better and more future proof to ask the service provider to raise their limits for this shop.
    – mr_typo3
    Oct 5, 2016 at 9:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.