composer 安装提示killed解决办法

composer 安装或者更新时报错 killed,因为当前内存不足

按照下面的步骤给 swap 增加内存即可

free -m
mkdir -p /var/_swap_
cd /var/_swap_
# Here, 1M * 2000 ~= 2GB of swap memory
dd if=/dev/zero of=swapfile bs=1M count=2000
mkswap swapfile
swapon swapfile
echo “/var/_swap_/swapfile none swap sw 0 0>> /etc/fstab
# cat /proc/meminfo
free -m

原文链接