Ubuntu 22.04 LTS和作曲家卷发错误60- SSL证书问题:无法获得本地发行人证书
当我将基于作曲家的项目或“诊断”命令 Composer诊断-VVV
使用“诊断”命令时,我会得到错误:
“下载 https://repo.packagist.org/packages.org/packages.json :SSL证书问题:无法获得本地发行人证书“
我已经尝试:
- 更新到最新的Ubuntu(22.04),并专门使用:
sudo apt install ca-certificates --reinstall
sudo update-ca-certificates -f
- 固定的不匹配路径,这似乎是原始问题(请参阅:在尝试时我在尝试使用卷发时处理证书访问https url?):
sudo mkdir -p /etc/pki/tls/certs
sudo ln -s /etc/pki/tls/certs/ca-bundle.crt /etc/pki/tls/certs/ca-certificates.crt
实际上,诊断为预期:
检查ca file /etc/pki/tls/certs/ca-bundle.crt:有效
- 重播作曲家安装程序
一些可能有用的信息:
Composer version: 2.2.6
PHP version: 8.1.2
PHP binary path: /usr/bin/php8.1
OpenSSL version: OpenSSL 3.0.2 15 Mar 2022
cURL version: 7.81.0 libz 1.2.11 ssl OpenSSL/3.0.2
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
重新运行 Composer installer 。 IIRC IT带有自己的证书商店或至少有一些后备包。
对于您的操作系统,请使用标准更新过程。
Re-run the composer installer. IIRC it ships with its own certificate store or at least has some fallback package.
For your operating system, use the standard update procedure.
最终通过手动替换ca-bundle.crt文件来解决它,因为意识到即使是简单的curl/wget cli命令(在PHP/Composer之外)返回了相同的错误(这是-no-check-的原因下面的证书):
我从: https://curl.se/docs/caextract/caextract /a>
Finally managed to solve it by manually replacing the ca-bundle.crt file, after realizing that even a simple curl/wget CLI command (outside of PHP/Composer) returned the same error (this the reason of the --no-check-certificate below):
I got the link from: https://curl.se/docs/caextract.html