Composer\Downloader\TransportException ... Failed to enable crypto,failed to open stream: operati...

一曲冷凌霜 提交于 2021-02-14 02:37:30

failed to open stream: operation failed


 

错误详细信息:

[Composer\Downloader\TransportException] 
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
[Composer\Downloader\TransportException]
  Content-Length mismatch, received 3444 bytes out of the expected 299952

错误发生情境:

  使用 composer require 命令下载软件时。

解决办法:

  (1)更换composer镜像源,可以执行尝试以下几种:

    更换成阿里镜像:composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

    更换成Laravel China镜像: composer config -g repo.packagist composer https://packagist.laravel-china.org

    更换成中国全量镜像:composer config -g repo.packagist composer https://packagist.phpcomposer.com

  (2)如果更换镜像,还不能下载成功,可能是网络有问题:

      1、(虚拟机环境)可以尝试把静态ip更换为动态获取,桥接改为网络地址转换。

      2、通过ftp或文件共享方式下载然后上传。


 

 

    

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!