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

遇到问题?

  • 1. 建议先将Composer版本升级到最新:

composer self-update    或者   composer self-update  --2

  • 2. 执行诊断命令:

composer diagnose

  • 3. 清除缓存:

composer clear

  • 4. 若项目之前已通过其他源安装,则需要更新 composer.lock 文件,执行命令:

composer update --lock

 

镜像地址

 

 

 

 

 

 

 

 

发布时间 : 2023-03-01,阅读量:2123 , 分类: PHP Composer
本文链接:https://upwqy.com/details/425.html
禁止谷歌浏览器强制跳转到https php开发常用composer依赖包