PHP7.3 で break と continue の取り扱いが変更になった影響で、composer install がエラーになる場合、
<
ul>
$ composer global require "laravel/installer"
Changed current directory to /home/yoo/.config/composer
Using version ^2.0 for laravel/installer
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Installation failed, deleting ./composer.json.
[ErrorException]
"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--] []...
特に初期設定で composer のバージョンが低い場合は注意が必要 (composer self-udpate がないなど) composer installができなくなった時の解決法(PHP7.3)
$ sudo update-alternatives --config php
選択肢 パス 優先度 状態
------------------------------------------------------------
*0 /usr/bin/php7.3 73 自動モード
1 /usr/bin/php5 50 手動モード
2 /usr/bin/php7.0 70 手動モード
3 /usr/bin/php7.2 72 手動モード
4 /usr/bin/php7.3 73 手動モード
composer-setup.php をダウンロード・実行する
$ curl -sS https://getcomposer.org/installer | php
$ sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
$ composer -V
Composer version 1.8.5 2019-04-09 17:46:47
2019/12/09追記 一発でインストールする
$ curl -s https://getcomposer.org/installer | php && sudo mv -v composer.phar /usr/local/bin/composer