Skip to content

memory limit

Increase PHP Memory When Running Magento 2 Command

When running CLI commands on a Magento 2 installation the issue of memory can arise. For example, when running a composer command the memory limit will sometimes be reached, generating an error and the command being terminated. The ability to increase the PHP memory limit for that command only is needed. The following command is an example where I need to run upgrade composer, but need to increase the memory limit 2048 MB. php -d memory_limit=2048M /bin/composer upgrade