Jesús Amieiro

PHP Composer killed

PHP logo

PHP logo

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

Exit mobile version