$ composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
如果仅限当前项目使用镜像,去掉 -g 即可,如下
$ composer config repo.packagist composer https://mirrors.aliyun.com/composer/
$ composer config -g --unset repos.packagist
composer
命令后面加上 -vvv (是 3 个 v)可以打印出调错信息,命令如下:
$ composer -vvv create-project laravel/laravel blog
$ composer -vvv require psr/log