Composer Update failed — out of memory

后端 未结 25 2627
再見小時候
再見小時候 2020-12-01 00:40

I got this error when running composer.phar update on my VM:

PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried t

25条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-01 01:12

    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).

提交回复
热议问题