3
0

More than 3 years have passed since last update.

composer経由でGuzzleをインストールしたらメモリエラーになったときの対処法

Posted at

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/

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0