php -f bin/magento cache:flush

php bin/magento setup:upgrade

Commands giving this error.Please check this, https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-error For more info on how to handle out of memory errors.

  • Please edit /etc/php/<PHP_version>/apache2/php.ini. and set memory_limit = -1. Mar 31, 2018 at 4:53

2 Answers 2


Run below command:

Static content deploy:

php -dmemory_limit=6G bin/magento setup:static-content:deploy

Cache flush:

php -dmemory_limit=6G bin/magento cache:flush

Setup Upgrade:

php -dmemory_limit=6G bin/magento setup:upgrade
  • Now problem is when i enter any command.is not proceeding any actions Mar 30, 2018 at 8:21
  • Try increasing the limit in your php.ini.` memory_limit = -1` Mar 30, 2018 at 8:57

php -dmemory_limit=6G great this is working now .. i can run commands thanks

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.