composer install 解决:The “https://packagist.laravel-china.org/packages.json” file could not be downloaded

使用composer安装错误提示:

[Composer\Downloader\TransportException]                                                                                                                          
  The "https://packagist.laravel-china.org/p/barryvdh/laravel-debugbar%243a79d93b15ef75dbf39115e34ff88576936f3f398af0abe2e941188d52f0be7b.json" file could not be   
  downloaded: SSL operation failed with code 1. OpenSSL Error messages:                                                                                             
  error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed                                                                                 
  Failed to enable crypto                                                                                                                                           
  failed to open stream: operation failed
按说明是镜像地址请求出错,于是去https://packagist.laravel-china.org 查看,发现Laravel China在一个月前发了篇文章《Laravel China 镜像完成历史使命,将于两个月后停用》,所以很明白了,你需要换镜像。

阿里云 Composer 全量镜像

Packagist 官方实时同步,推荐使用最新的 Composer 版本。

  • 镜像类型:全量镜像
  • 更新时间:1 分钟
  • 镜像说明:阿里云 CDN 加速,更新速度快,推荐使用

全局配置(推荐)

所有项目都会使用该镜像地址:

composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

取消配置:

composer config -g --unset repos.packagist
阅读 462

Comments