composer使用国内的镜像,会比较方便一点。网络更畅通。这里用阿里云的镜像设置。composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
设置的方法
# Author: www.phpjiaocheng.com
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
如果使用的是linux系统,通常执行命令后可以查看到以下的配置信息
# Author: www.phpjiaocheng.com
{
"config": {},
"repositories": {
"packagist": {
"type": "composer",
"url": "https://mirrors.aliyun.com/composer/"
}
}
}
取消配置的方法
composer config -g --unset repos.packagist
查看全局配置可以 composer config -gl
查看资料: https://developer.aliyun.com/composer