proc_open(): fork failed – Cannot allocate memory

proc_open(): fork failed – Cannot allocate memory

ec2上で、laravelプロジェクト作ろうとしたら、メモリエラー?

$ sudo composer create-project –prefer-dist laravel/laravel sitename 5.8
Installing laravel/laravel (v5.8.0)

  • Installing laravel/laravel (v5.8.0): Loading from cache
    Created project in companylist

@php -r “file_exists(‘.env’) || copy(‘.env.example’, ‘.env’);”
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 80 installs, 0 updates, 0 removals

  • Installing symfony/polyfill-ctype (v1.12.0): Downloading (100%)
    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/bin/composer/vendor/symfony/console/Application.php on line 952

Warning: proc_open(): fork failed – Cannot allocate memory in phar:///usr/bin/composer/vendor/symfony/console/Application.php on line 952

[ErrorException]
proc_open(): fork failed – Cannot allocate memory

create-project [-s|–stability STABILITY] [–prefer-source] [–prefer-dist] [–repository REPOSITORY] [–repository-url REPOSITORY-URL] [–dev] [–no-dev] [–no-custom-installers] [–no-scripts] [–no-progress] [–no-secure-http] [–keep-vcs] [–remove-vcs] [–no-install] [–ignore-platform-reqs] [–] [] [] []

swapがない?

$free -m

              total        used        free      shared  buff/cache   available

Mem:            983         272         624           0          86         588

Swap:             0           0           0

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

コメントする

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

*

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください