由于某些原因composer无法使用或者速度过慢的解决办法

全局配置(推荐)

所有项目都会使用该镜像地址:

composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/


取消配置:

composer config -g --unset repos.packagist


项目配置

仅修改当前工程配置,仅当前工程可使用该镜像地址:

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


取消配置:

composer config --unset repos.packagist


其他镜像

phpcomposer

https://pkg.phpcomposer.com/


Laravel-China

https://packagist.laravel-china.org/


Packagist 中国全量镜像

https://php.cnpkg.org/


composer config -g repos.packagist composer https://php.cnpkg.org