我在 Windows 机器上使用原生 PHP 5.6 有问题。当我尝试运行作曲家更新(php composer.phar 更新)时出现此错误:
[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"
但它没有工作,仍然是同样的错误。