composer报错failed to open stream: operation failed

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
[Composer\Downloader\TransportException] The
“https://packagist.laravel-china.org/p/alibabacloud/client%242af159d2c938f36152d6b20322723c27286f3fbae7170b960d
b728b9a5915df8.json” file could not be downloaded: Peer certificate
CN=*.phphub.org' did not match expected CN=pa
ckagist.laravel-china.org’ Failed to enable crypto failed to open
stream: operation failed

解决方案:

方法一: 修改 composer 的全局配置文件(推荐方式)
打开命令行窗口(windows用户)或控制台(Linux、Mac 用户)并执行如下命令:

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

方法二: 修改当前项目的 composer.json 配置文件:
打开命令行窗口(windows用户)或控制台(Linux、Mac 用户),进入你的项目的根目录(也就是 composer.json 文件所在目录),执行如下命令:

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

原文链接:https://blog.csdn.net/weixin_38375151/article/details/102400379

posted @   Lafite-1820  阅读(252)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示