composer官网下载太慢,上传一个composer.phar
2、将composer.phar文件移动到bin目录以便全局使用composer命令
# mv composer.phar /usr/local/bin/composer
# chmod +x /usr/local/bin/composer
3、切换国内源,-g是全局安装
// 阿里的镜像
# composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
// laravel的镜像
# composer config -g repo.packagist composer https://packagist.laravel-china.org