技术分享 composer update 报错:proc_open(): fork failed - Cannot allocate memory
在 使用 composer update
命令时,出现如下错误:
The following exception is caused by a lack of memory or swap, or not having swap configured
Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details
[ErrorException]
proc_open(): fork failed - Cannot allocate memory
一般小的VPS 才1G内存,如果使用composer会提示内存不足的现象
解决办法,可以使用交换内存
直接命令
/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1
不限制内存使用 php -d memory_limit=-1 composer.phar
猜你喜欢:
暂无回复。