1.下载composer.phar文件 curl -sS https://getcomposer.org/installer | php 。
curl -sS https://getcomposer.org/installer | php

2.运行
php conposer.phar
会出现composer的标志 php conposer.phar

3.复制composer.phar 到系统 bin 目录
mv composer.phar /usr/local/bin/composer
或者 cp composer.phar /usr/local/bin/composer

  1. 到/usr/local/bin 修改composer文件的权限
    chmod 744 composer

切换国内源
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/