Fix “Fatal error: Allowed memory size of X bytes exhausted (tried to allocate X bytes)” with composer update

I got this error today when running composer update for one of my Symfony2 projects:

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 3781182 bytes) in phar:///usr/local/bin/composer/src/Composer/Util/RemoteFilesystem.php on line 202

logo-composer-transparent

Composers troubleshooting tells that you can increase the memory PHP can allocate editing memory_limit parameter in php.ini. I changed it from 128M to 512M but still didn’t work.

Finally the solution was to run composer update with no memory limit this way:

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

You might also like

Update composer and all packages installed with it
php composer.phar self-update php composer.phar updatephp composer.phar self-update php composer.phar...
Fix “Cannot redeclare class Symfony\…” in Symfony2 after upgrade
After upgrading from Symfony 2.2 to 2.3 I got this error in my application: Fatal error: Cannot redeclare...
Install a Symfony2 application using Composer
Before installing any Symfony2 project you have to meet the minimum requirements for it in your server....
Install Raspbian RAW image into an SD Card in Mac OS X
First download a Raspbian RAW image from here: http://www.raspberrypi.org/downloads Plug-in your SD...
Leave a comment ?

3 Comments.

  1. Do you know how to change it in capifony deploy script?

    Reply

Leave a Comment