Composer Update failed — out of memory

Check the Composer’s troubleshooting wiki, especially the memory limit errors section.

For instance, by running the composer like this:

php -d memory_limit=-1 `which composer` update

I get no error anymore. So it is probably an insufficient memory issue that can be solved inline, without altering your default PHP configuration.

What the command above does is that it sets the PHP CLI memory limit to “unlimited” (ie. -1) and then it runs the inline composer update command.

Please note that instead of `which composer` you should probably use the real path of your composer.phar PHP script. The which composer written inline (like in my example above) will be inline solved to your composer.phar full path (you may use whatever form you like).

Note: in case both the physical and virtual memory is exceeded the above solution might fail as well. If that is the case then the obvious solution would be to increase your system’s virtual memory then try again.

Leave a Comment