DEV Community

StuartCreed
StuartCreed

Posted on • Updated on

How to fix PHP Composer memory limit issues

If composer is installed globally on MacOS Catalina run:

php -d memory_limit=-1 /usr/local/bin/composer update --no-plugins

https://stackoverflow.com/questions/49212475/composer-require-runs-out-of-memory-php-fatal-error-allowed-memory-size-of-161

OR

Putting COMPOSER_MEMORY_LIMIT=-1 in your .zshrc (not .bashrc as since 2019 MACOS ships with zsh shell as default) file works for some people -> although I have not tested this version of the fix myself.

OR

Override temporarily with:
COMPOSER_MEMORY_LIMIT=-1 composer install

Top comments (0)