修改Composer镜像下载地址

查看配置

composer config -l -g # 全局配置
composer config -g repo.packagist # 项目配置

修改配置

镜像地址有:https://php.cnpkg.orghttps://packagist.phpcomposer.comhttps://packagist.laravel-china.org 等可供选择,这里以php.cnpkg.org配置为例。

  • 全局配置
composer config -g repos.packagist composer https://php.cnpkg.org
  • 单独项目配置
composer config repo.packagist composer https://php.cnpkg.org
  • 关闭全局配置
composer config -g --unset repos.packagist

还原配置

composer config -g repo.packagist composer https://packagist.org

参考链接

results matching ""

    No results matching ""