Error Installing Composer on Windows 7 64-bit with Wampserver 2.5

荒凉一梦 提交于 2019-12-23 04:17:13

问题


I'm trying to install the Composer on W7 64x. Using the installer for Windows that the site Composer provides (Composer-setup.exe).

I have installed the Wampserver 2.5 with php5.5.12 and Apache2.4.9. The openssl is enabled in php.ini.

I'm having the following errors in the installation:

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.

I installed xampp and WPN XM, but using the php.exe of both shows the following error:

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:


Ensure that the SSL certs are installed and found by PHP.

In php.ini:

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

If certs are missing: download a cert bundle from http://curl.haxx.se/ca/cacert.pem and save as ca-bundle.crt.

(Or simply use a server stack for Windows, which ships Composer right out-of-the-box: WPN-XM)



来源:https://stackoverflow.com/questions/29729066/error-installing-composer-on-windows-7-64-bit-with-wampserver-2-5

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