aliyun 阿里云 Composer 全量镜像
-本镜像与 Packagist 官方实时同步,推荐使用最新的 Composer 版本。
- 最新版本: 2.6.5
- 下载地址: https://mirrors.aliyun.com/composer/composer.phar
全局配置(推荐)
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
遇到问题?
- 建议先将Composer版本升级到最新:
composer self-update
- 执行诊断命令:
composer diagnose
- 清除缓存:
composer clear
- 若项目之前已通过其他源安装,则需要更新 composer.lock 文件,执行命令:
composer update --lock
- 配置阿里云和官方两个源,阿里云镜像站下载文件出错时再从官方源上下载。
{
"repositories": [
{
"description": "阿里云镜像",
"type": "composer",
"url": "https://mirrors.aliyun.com/composer/",
"canonical": false
}
]
}
- 重试一次,若还有问题,请到钉钉群:23178217 反映。