Native PHP 5.6 OpenSSL Composer.phar failed to enable crypto on Windows

守給你的承諾、 提交于 2019-12-04 05:51:38

问题


I have a problem with PHP 5.6 native on a Windows machine. I get this error when I try to run a 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

The openssl extension is loaded. I already downloaded this file http://curl.haxx.se/ca/cacert.pem and saved it to a path on my machine and set this path in the php.ini like

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

But it didn't work, still the same error.


回答1:


Ok, problem solved: I had to remove https-proxy from system variables. Don't know why, but it works...




回答2:


Run the following command without 'sudo' :

composer update



来源:https://stackoverflow.com/questions/32178980/native-php-5-6-openssl-composer-phar-failed-to-enable-crypto-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!