以阿里云为例,全局模式(推荐):

$ composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ 单独项目使用:

$ composer config repo.packagist composer https://mirrors.aliyun.com/composer/

然后再下载