LoginSignup
9
7

More than 3 years have passed since last update.

composerでメモリ制限エラーがでた話

Posted at

エラー内容

Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/bin/composer/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52
Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.

メモリーが足りないよ!ってエラーが帰ってきた

なので下記コマンドでメモリーの許可されている容量を調べると

php -r 'phpinfo();' | grep memory_limit
memory_limit => 128M => 128M

128Mじゃそりゃ足りないわな,,,,

ので下記コマンドを実行

tarminal
COMPOSER_MEMORY_LIMIT=-1 composer 〇〇(インストールorアップデートしたいパッケージ)

COMPOSER_MEMORY_LIMIT=-1は一時的にメモリを使いたい分一時的に使えるようにするよ!って意味
それと一緒にインストールしたいパッケージを記述し実行

9
7
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
9
7