78
53

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

EC2のmicro instanceでcomposer updateがコケる場合のメモ

Posted at

EC2のmicro instanceでcomposer updateを行った場合、メモリ不足で壮大にコケる場合がある。

PHP Fatal error:  Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar://path/to/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:983

httpdとかmysqldとか動いてる場合、一時的に止めてやれば行ける場合もある。
でも、それでもダメな場合はスワップファイルを作ってやる。

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

Ref: https://github.com/composer/composer/issues/945#issuecomment-8552757

78
53
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
78
53

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?