如果没有安装composer需要行安装,安装成功以后,只用执行一条命令即可。
composer 使用阿里云镜像
# Author: www.phpjiaocheng.com
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
这个表示进行全局安装。
查看是否已经切换成功
# Author: www.phpjiaocheng.com
composer config -g -l | grep "org.url"
[repositories.packagist.org.url] https?://repo.packagist.org
这个是默认的使用的 https?://repo.packagist.org
切换成功后
# Author: www.phpjiaocheng.com
composer config -g -l | grep "org.url"
[repositories.packagist.org.url] https://mirrors.aliyun.com/composer/
阿里云官方镜像地址 https://developer.aliyun.com/composer
腾讯云的composer 镜像
# Author: www.phpjiaocheng.com
composer config -g repos.packagist composer https://mirrors.cloud.tencent.com/composer/