首页 > 其他分享 >composer报错failed to open stream: operation failed

composer报错failed to open stream: operation failed

时间:2022-12-16 21:12:07浏览次数:57  
标签:china https stream failed 报错 composer packagist org

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

标签:china,https,stream,failed,报错,composer,packagist,org
From: https://www.cnblogs.com/hefeng2014/p/16988291.html

相关文章