Composer killed while updating

后端 未结 16 1962
野性不改
野性不改 2020-11-28 19:40

I got a problem, I tried to install a new package to my Laravel 4 project. But when I run php composer.phar update I get this:

Loading composer          


        
16条回答
  •  心在旅途
    2020-11-28 19:56

    Unfortuantely composer requires a lot of RAM & processing power. Here are a few things that I did, which combined, made the process bearable. This was on my cloud playpen env.

    1. You may be simply running out of RAM. Enable swap: https://www.digitalocean.com/community/search?q=add+swap (note: I think best practice is to add a seperate partition. Digitalocean's guide is appropriate for their environment)
    2. service mysql stop (kill your DB/mem-hog services to free some RAM - don't forget to start it again!)
    3. use a secondary terminal session running top to watch memory/swap consumption until process is complete.
    4. composer.phar update --prefer-dist -vvv (verbose output [still hangs at some points when working] and use distro zip files). Maybe try a --dry-run too?
    5. Composer is apparently know to run slower in older versions of PHP (e.g. 5.3x). It was still slow in 5.5.9 for me...

提交回复
热议问题