gpt4 book ai didi

php - Composer curl 错误 60 : SSL certificate problem: self signed certificate in certificate chain

转载 作者:行者123 更新时间:2023-12-04 22:39:53 41 4
gpt4 key购买 nike

我正在使用 Symfony 5,我需要使用 composer 安装 'knplabs/knp-snappy-bundle' 但我有这个消息:

[Composer\Downloader\TransportException]
curl error 60 while downloading https://repo.packagist.org/packages.json: SSL certificate problem: self signed certificate in certificate chain
请帮我
我尝试将 cacert.pem 添加到我的 php.ini 中
curl.cainfo ="C:/wamp64/bin/php/php7.3.21/extras/ssl/cacert.pem"
我试图在我的 composer.json 中禁用 verify_peer,但没有任何效果。
这是我的 Composer 诊断:
Checking composer.json: WARNING
require.composer/package-versions-deprecated : exact version constraints (1.11.99.1) should be avoided if the package follows semantic versioning

Checking platform settings: OK

Checking git settings: OK

Checking http connectivity to packagist: OK

Checking https connectivity to packagist: FAIL
[Composer\Downloader\TransportException] curl error 60 while downloading https://repo.packagist.org/packages.json: SSL certificate problem: self signed certificate in certificate chain

Checking github.com rate limit: FAIL
[Composer\Downloader\TransportException] curl error 60 while downloading https://api.github.com/rate_limit: SSL certificate problem: self signed certificate in certificate chain

Checking disk free space: OK

Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0 87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B 0C708369 153E328C AD90147D AFE50952
OK

Checking composer version: FAIL
[Composer\Downloader\TransportException] curl error 60 while downloading https://getcomposer.org/versions: SSL certificate problem: self signed certificate in certificate chain

Composer version: 2.0.13
PHP version: 7.3.21
PHP binary path: C:\wamp64\bin\php\php7.3.21\php.exe
OpenSSL version: OpenSSL 1.1.1g 21 Apr 2020
cURL version: 7.70.0 libz 1.2.11 ssl OpenSSL/1.1.1g
zip: extension present, unzip present
请帮我

可能是我的 Composer 配置有问题

"config": {
"optimize-autoloader": true,
"preferred-install": {
"*": "dist"
},
"sort-packages": true,
"options": {
"ssl": {
"verify_peer": false,
"allow_self_signed": false,
"cafile": "C:/wamp64/bin/php/php7.3.21/extras/ssl/cacert.pem",
"local_cert": "C:/wamp64/bin/php/php7.3.21/extras/ssl/cacert.pem"
}
}

},

最佳答案

此配置选项:allow_self_signed不知从何而来,没有任何作用;它甚至没有出现在 Composer 的文档中。
由于这种误导性的选择,我浪费了数小时的宝贵时间。
如果您有类似的问题,我建议您使用最新版本的 PHP(显然满足您的要求)和最新的 Composer 版本等。对我有用,但 YMMV。

关于php - Composer curl 错误 60 : SSL certificate problem: self signed certificate in certificate chain,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69769456/

41 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com