proc_open(): fork failed errors

2018-11-22 liyangweb.com 李杨 PHP

If composer shows proc_open() fork failed on some commands:
PHP Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar

This could be happening because the VPS runs out of memory and has no Swap space enabled.

free -m

total used free shared buffers cached
Mem: 2048 357 1690 0 0 237
-/+ buffers/cache: 119 1928
Swap: 0 0 0

To enable the swap you can use for example:

/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1

You can make a permanent swap file following this tutorial.


转自:https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors

评论:

网站建设
2018-12-03 11:14
这文章写的不错

发表评论:

Powered by emlog 冀ICP备13011830号-1