【问题标题】:Composer update fails with OpenSSL errorComposer 更新失败并出现 OpenSSL 错误
【发布时间】:2017-07-31 18:21:42
【问题描述】:

我正在使用 WAMP 3.0.6(Apache 2.4.23、PHP 5.6.25)在 Windows 10 上工作,当我尝试运行 composer update 它使用 OpenSSL 显示错误:

Loading composer repositories with package information
The "https://packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
https://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date
Updating dependencies (including require-dev)

我已经在 c:\wamp\bin\php\php5.6.25\php.ini 中设置了 openssl.cafile 变量,并确认 CLI 使用了这个 php.ini 文件。

php -r "var_dump(openssl_get_cert_locations());"的输出

array(8) {
  ["default_cert_file"]=>
  string(25) "c:/usr/local/ssl/cert.pem"
  ["default_cert_file_env"]=>
  string(13) "SSL_CERT_FILE"
  ["default_cert_dir"]=>
  string(22) "c:/usr/local/ssl/certs"
  ["default_cert_dir_env"]=>
  string(12) "SSL_CERT_DIR"
  ["default_private_dir"]=>
  string(24) "c:/usr/local/ssl/private"
  ["default_default_cert_area"]=>
  string(16) "c:/usr/local/ssl"
  ["ini_cafile"]=>
  string(29) "c:/wamp/openssl/cacert.pem"
  ["ini_capath"]=>
  string(16) "c:/wamp/openssl/"
}

我从http://curl.haxx.se/ca/cacert.pem 下载了证书文件并尝试将其放置到不同的位置:

c:/wamp/openssl/
c:/usr/local/ssl/certs
c:/usr/local/ssl/cert.pem

我什至尝试使用 getcomposer.org 中的 composer-setup.exe 重新安装 composer,但它以同样的错误结束。

我搜索了 stackoverflow 并搜索了几个小时,但任何可能的解决方案都没有奏效。我做错了什么?

【问题讨论】:

标签: php composer-php


【解决方案1】:

尝试取消设置https_proxy 使作曲家能够工作!

【讨论】:

  • 抱歉这个愚蠢的问题,但我必须在哪里取消设置 https_proxy ?
  • 这是我得到的:'unset' 不是内部或外部命令、可运行程序或批处理文件。
猜你喜欢
  • 2014-09-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-06-24
  • 2021-04-24
  • 2019-07-29
  • 2013-09-17
相关资源
最近更新 更多