PHP logo

PHP Composer killed

Executing the command

composer update

in a Laravel Homestead virtual machine with 2 GB of RAM, I can’t finish it because the command stops with the output

killed

Usually, this output means that the process is consuming too much memory.

To solve it, I have created a swap file of 2 GB.

mkdir -p /var/_swap_
cd /var/_swap_
dd if=/dev/zero of=swapfile bs=1M count=2000
mkswap swapfile
swapon swapfile
chmod 600 swapfile
echo "/var/_swap_/swapfile none swap sw 0 0" >> /etc/fstab
free -m

More info: https://stackoverflow.com/a/34998803/77909

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.