使用Wampserver 2.5在64位Windows 7上安装Composer时出错

时间:2015-04-19 11:12:42

标签: windows-7 installation openssl composer-php file-get-contents

我试图在W7 64x上安装Composer。使用site Composer提供的Windows安装程序(Composer-setup.exe)。

我已经使用php5.5.12和Apache2.4.9安装了Wampserver 2.5。 openssl在php.ini中启用。

我在安装中遇到以下错误:

Download failed: file_get_contents(): SSL operation failed with code 1. OpenSSL Error
messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
file_get_contents(): Failed to enable crypto
file_get_contents(https://getcomposer.org/composer.phar): failed to open stream: operation
failed
Download failed: file_get_contents(): SSL operation failed with code 1. OpenSSL Error
messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
file_get_contents(): Failed to enable crypto
file_get_contents(https://getcomposer.org/composer.phar): failed to open stream: operation
failed
Download failed: file_get_contents(): SSL operation failed with code 1. OpenSSL Error
messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
file_get_contents(): Failed to enable crypto
file_get_contents(https://getcomposer.org/composer.phar): failed to open stream: operation
failed
The download failed repeatedly, aborting.

我安装了xampp和WPN XM,但是使用两者的php.exe都显示以下错误:

Connection Error [ERR_CONNECTION]: Unable to connect to getcomposer.org
Request to https://getcomposer.org/installer failed with errors:
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

1 个答案:

答案 0 :(得分:4)

确保PHP安装并找到SSL证书。

php.ini

curl.cainfo=/path/to/ssl-certs/ca-bundle.crt
openssl.cafile=/path/to/ssl-certs/ca-bundle.crt

如果缺少证书:从http://curl.haxx.se/ca/cacert.pem下载证书捆绑包并保存为ca-bundle.crt

(或者只是使用Windows的服务器堆栈,即开箱即用的Composer:WPN-XM