arn*_*rno 5 memory fork proc-open composer-php
我对composer有问题,它一直运行良好,但现在不想……
这是一个简单composer install命令的结果:
bob@SRV04:~/testdir$ composer install
Loading composer repositories with package information
Updating dependencies
Package operations: 44 installs, 0 updates, 0 removals
- Installing psr/container (1.0.0): 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
PHP Warning: proc_open(): fork failed - Cannot allocate memory in
phar:///bin/composer/vendor/symfony/console/Application.php on line 952
Warning: proc_open(): fork failed - Cannot allocate memory in
phar:///bin/composer/vendor/symfony/console/Application.php on line 952
[ErrorException]
proc_open(): fork failed - Cannot allocate memory
Run Code Online (Sandbox Code Playgroud)
问题是,鉴于我的记忆状态,一切都应该有效。
free -h
total used free shared buffers cached
Mem: 7,8G 3,4G 4,4G 131M 207M 503M
-/+ buffers/cache: 2,7G 5,1G
Swap: 1,7G 728M 971M
Run Code Online (Sandbox Code Playgroud)
我看到还有其他几个问题与此问题类似,但没有一个提出修复该错误的解决方案
COMPOSER_MEMORY_LIMIT=-1 composer update
Run Code Online (Sandbox Code Playgroud)
那个额外的小命令挽救了我在旧服务器上的生命。