The "Killed" message usually means your process consumed too much memory, so you may simply need to add more memory to your system if possible. At the time of writing this answer, I've had to increase my virtual machine's memory to at least 768MB in order to get composer update
to work in some situations.
However, if you're doing this on a live server, you shouldn't be using composer update
at all. What you should instead do is:
- Run
composer update
in a local environment (such as directly on your physical laptop/desktop, or a docker container/VM running on your laptop/desktop) where memory limitations shouldn't be as severe.
- Upload or
git push
the composer.lock file.
- Run
composer install
on the live server.
composer install
will then read from the .lock file, fetching the exact same versions every time rather than finding the latest versions of every package. This makes your app less likely to break, and composer uses less memory.
Read more here: https://getcomposer.org/doc/01-basic-usage.md#installing-with-composer-lock
Alternatively, you can upload the entire vendor
directory to the server, bypassing the need to run composer install
at all, but then you should run composer dump-autoload --optimize
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…