You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows环境下Composer更新遇curl error 60 SSL证书问题求助

问题:Windows环境下Composer更新时出现SSL证书错误(curl error 60)

在Windows机器(PHP 8.3 + Apache 2.4)上对Laminas项目执行composer update时,突然出现如下错误:

curl error 60 while downloading https://repo.packagist.org/packages.json: SSL certificate problem: unable to get local issuer certificate

已尝试的解决方案(均无效)

  • 禁用杀毒软件
  • 下载最新cacert.pem并修改php.ini配置curl.cainfo和openssl.cafile指向证书路径
  • 修改composer config.json中"disable-tls": false后更新Composer版本
  • 卸载最新Windows更新
  • 执行composer self-update --update-keys

composer diagnose诊断结果

Checking composer.json: OK
Checking platform settings: OK
Checking git settings: No git process found
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: unable to get local issuer certificate
Checking github.com rate limit: FAIL
[Composer\Downloader\TransportException] curl error 60 while downloading https://api.github.com/rate_limit: SSL certificate problem: unable to get local issuer certificate
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: ***
Dev Public Key Fingerprint: ***
OK
Checking Composer version: FAIL
[Composer\Downloader\TransportException] curl error 60 while downloading https://getcomposer.org/versions: SSL certificate problem: unable to get local issuer certificate
Checking Composer and its dependencies for vulnerabilities: Failed performing audit: curl error 60 while downloading https://repo.packagist.org/packages.json: SSL certificate problem: unable to get local issuer certificate
Composer version: 2.8.5
PHP version: 8.3.17
PHP binary path: C:\PHP\php.exe
OpenSSL version: OpenSSL 3.0.15 3 Sep 2024
curl version: 8.7.0-DEV libz 1.2.12 ssl OpenSSL/3.0.15
zip: extension present, unzip not available, 7-Zip not available

cacert.pem验证异常

验证流程

  1. 获取官方cacert.pem文件
  2. 上传至Composer配置指定的证书目录
  3. 通过PHP代码echo hash_file('sha256', 'cacert.pem', false);计算文件哈希值

结果

三方哈希值均不匹配:

  • 本地下载文件哈希值:SHA256: ***d3aca3c05c566d8dc98e116
  • PHP计算的哈希值:***b934ca495991b7852b855
  • 官方提供的哈希值:***90425d7da901a11531b3aa5

内容的提问来源于stack exchange,提问作者Jilco Tigchelaar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 09:57:04