【问题标题】:Error Installing Composer on Windows 7 64-bit with Wampserver 2.5在带有 Wampserver 2.5 的 Windows 7 64 位上安装 Composer 时出错
【发布时间】:2015-06-26 01:37:24
【问题描述】:

我正在尝试在 W7 64x 上安装 Composer。使用 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

【问题讨论】:

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


    【解决方案1】:

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

    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

    【讨论】:

    • 我安装了 WPN-XM (WPNXM-0.8.2-Full-Setup-php55-w64.exe) 但还显示了一个错误。我将编辑我的问题。
    • 当您使用 WPN-XM 时,Composer 已经安装。打开命令提示符,执行composer。完毕。 composer.phar 位于 \bin\php 中, composer.bat 作为快捷方式。将php文件夹添加到ENV路径,这样就可以全局访问了。
    猜你喜欢
    • 2012-10-11
    • 2015-03-30
    • 2014-06-30
    • 1970-01-01
    • 1970-01-01
    • 2020-04-03
    • 1970-01-01
    • 1970-01-01
    • 2011-01-26
    相关资源
    最近更新 更多