hey guys i have a problem running Meagento commands setup & compile because of memory limit it's 256.

i have requested from the hosting company to increase my memory limit to 1024MB and they did. i can see the change on php.ini file at root folder in cpanel.

but when i ran the commands i got the same errors again of memory limit so i checked the limit with

php -r "echo ini_get('memory_limit').PHP_EOL;"

i found that it is still 256MB. Is there any place where in my Magento that this limit is saved ???

any help please i'm stuck

  • No,magento does not save memory_limit
    – Amit Bera
    Commented Aug 7, 2017 at 15:32

2 Answers 2


Try these command:

php -dmemory_limit=1G bin/magento setup:upgrade
php -dmemory_limit=1G bin/magento setup:static-content:deploy
php -dmemory_limit=1G bin/magento setup:di:compile
  • like a charm. thank you so much i had no idea that i could increase memory with each command ..... thanks again
    – user57235
    Commented Aug 7, 2017 at 19:02

When you run

php -r "echo ini_get('memory_limit').PHP_EOL;"

you are not initializing magento at all.

It is possible, that your hoster increased memory limit for your webserver, but not for cli (which you are running here).

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.