Guzzle https://github.com/guzzle/guzzle
をインストールしようとしたら以下のようなエラーが出た。
Installation failed, reverting ./composer.json to its original content.
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:///usr/local/bin/composer/vendor/symfony/console/Application.php on line 952
Warning: proc_open(): fork failed - Cannot allocate memory in phar:///usr/local/bin/composer/vendor/symfony/console/Application.php on line 952
[ErrorException]
proc_open(): fork failed - Cannot allocate memory
メモリが足りないらしい。
対処法
↑のエラーに表示される
https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors
に書いてある以下のコマンドを順番に実行して、スワップファイルを作る&有効化する。
/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1
Permission denied と出た場合は sudo
をつけてください。
参考
https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors
https://evisu0414.com/engineer/engineer010/