1、下载composer.phar
curl -sS getcomposer.org/installer | php
2、把composer.phar移动到环境下让其变成可执行
mv composer.phar /usr/local/bin/composer
3、换中国镜像
使用阿里云的源,并对composer进行升级
代码语言:javascript复制`composer config -g repo.packagist composer https:
//mirrors.aliyun.com/composer/
`
复制代码
代码语言:javascript复制`composer selfupdate`
Buy me a cup of coffee :)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/15187e812ee64fdbb08728b60f00f21f~tplv-k3u1fbpfcp-zoom-1.image)
复制代码