Composer - 更换国内镜像源(解决安装更新太慢且失败的问题)/ 解除镜像源

前言

打开 Composer 键入下面的命令,即可实现换源,很简单。

查看当前源

composer config -g -l repo.packagist

换国内镜像源

哪个快用哪个!!!

## 中国全量镜像
composer config -g repo.packagist composer https://packagist.phpcomposer.com

## 腾讯云
composer config -g repos.packagist composer https://mirrors.cloud.tencent.com/composer/

## 阿里云
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

解除镜像(还原)

composer config -g --unset repos.packagist

执行之后,composer 会利用默认值(也就是官方源)重置源地址。

你可能感兴趣的:(+,Thinkphp)