centos7安装composer

  1. 下载composer.phar
// 如果是网络原因失败,多试几次
curl -sS https://getcomposer.org/installer | php
  1. 把composer.phar移动到环境下让其变成可执行
mv composer.phar /usr/local/bin/composer
  1. 测试
composer -v
  1. 修改镜像地址
composer config -g repo.packagist composer https://packagist.phpcomposer.com

你可能感兴趣的:(centos7安装composer)