参考:https://pkg.phpcomposer.com/

安装composer&配置国内镜像
  1. 下载:php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
  2. 安装:php composer-setup.php
  3. 删除安装文件:php -r "unlink('composer-setup.php');"
  4. 全局安装:sudo mv composer.phar /usr/local/bin/composer
  5. 配置国内镜像:composer config -g repo.packagist composer https://packagist.phpcomposer.com