composer 换阿里源
2023-02-20 程序界 1590
https://developer.aliyun.com/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
调试
composer 命令增加 -vvv 可输出详细的信息,命令如下:
composer -vvv require alibabacloud/sdk
1. 建议先将Composer版本升级到最新:
composer self-update
2. 执行诊断命令:
composer diagnose
3. 清除缓存:
composer clear
4. 若项目之前已通过其他源安装,则需要更新 composer.lock 文件,执行命令:
composer update --lock
5. 配置阿里云和官方两个源,阿里云镜像站下载文件出错时再从官方源上下载。tips:单击复制会出现问题,如需拷贝代码请先选中文本点击鼠标右键进行复制。
{ "repositories": [ { "description": "阿里云镜像", "type": "composer", "url": "https://mirrors.aliyun.com/composer/", "canonical": false } ] }
其他:
原始(默认)镜像
composer config -g repo.packagist composer https://repo.packagist.org
国内镜像
composer config -g repo.packagist composer https://packagist.phpcomposer.com
阿里云镜像
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
Laravel-China 镜像
composer config -g repo.packagist composer https://packagist.laravel-china.org
很赞哦! (0)
文章评论
-
-
-
0条评论