2017-07-31 99 views
0

我工作在Windows 10 WAMP 3.0.6(阿帕奇2.4.23,PHP 25年6月5日),当我尝试运行composer update 它显示与OpenSSL的错误:作曲家更新失败,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变量,并确认这个php.ini文件被CLI使用。

输出的 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作曲家SETUP.EXE .org,但它以相同的错误结束。

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

+0

听起来更像是证书本身的错误,而不是它在哪里? https://stackoverflow.com/questions/17084886/ssl-error-routinesssl3-get-server-certificatecertificate-verify-failed – Andy

+0

[file \ _get \ _contents()的可能重复:SSL操作失败,代码为1. [更多] (https://stackoverflow.com/questions/26148701/file-get-contents-ssl-operation-failed-with-code-1-and-more) – Nawin

回答

0

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

+0

对于愚蠢的问题抱歉,但我必须取消设置https_proxy? – Jaimez

+0

here:'C:\ wamp \ htdocs \ myproject \> unset http_proxy' –

+0

这就是我得到的:'unset'不被识别为内部或外部命令, 可操作的程序或批处理文件。 – Jaimez