解决 The "https://packagist.phpcomposer.com/packages.json" file could not be downloaded问题
使用composer self-update升级composer遇到问题:
The "https://getcomposer.org/versions" file could not be downloaded: failed to open stream: Connection timed out
这是镜像地址请求出错导致的,推荐使用阿里云 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 可输出详细的信息,命令如下:
来自:https://www.cnblogs.com/guanzelin/p/16066278.html
版权声明:导航君 发表于 2023年1月11日 下午3:36。
转载请注明:解决 The "https://packagist.phpcomposer.com/packages.json" file could not be downloaded问题 | 第八网址导航
转载请注明:解决 The "https://packagist.phpcomposer.com/packages.json" file could not be downloaded问题 | 第八网址导航
相关文章
暂无评论...