使用 Composer 安装 JWT 失败错误信息 The "https://packagist.org/packages.json" file could not be downloaded 解决办

用composer 集成时

composer update 命令报以下错误

Loading composer repositories with package information
The "https://packagist.laravel-china.org/packages.json" file could not be downloaded: Peer certificate CN=`*.phphub.org' did not match expected CN=`packagist.laravel-china.org'
Failed to enable crypto
failed to open stream: operation failed
https://packagist.laravel-china.org could not be fully loaded, package information was loaded from the local cache and may be out of date
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package  test  v1.0.0 exists as  test but these are rejected by your constraint.

出现这种错误主要是,composer 全局下载换成中国镜像的原因.

只需将下载源换会默认的就可以。可以使用下面命令修改 composer 配置信息

composer config -g repo.packagist composer https://packagist.phpcomposer.com

 

转载来自:https://learnku.com/articles/18351

 

你可能感兴趣的:(php)