原生PHP 5.6 OpenSSL Composer.phar无法在Windows上启用加密

时间:2015-08-24 09:37:30

标签: windows openssl server windows-server php-openssl

我在Windows机器上遇到了PHP 5.6本机问题。当我尝试运行composer update(php composer.phar update)时出现此错误:

[Composer\Downloader\TransportException]
The "https://packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
Failed to enable crypto
failed to open stream: operation failed

加载了openssl扩展。我已经下载了这个文件http://curl.haxx.se/ca/cacert.pem并将其保存到我机器上的路径中,并在php.ini中设置此路径,如

openssl.cafile = "c:\path\to\cacert.pem"

但它没有用,仍然是同样的错误。

2 个答案:

答案 0 :(得分:0)

好的,问题解决了:我不得不从系统变量中删除https-proxy。不知道为什么,但它有效......

答案 1 :(得分:-1)

运行以下命令,而不使用' sudo' :

  

作曲家更新