作曲家"下载失败"错误

时间:2014-09-29 08:38:15

标签: php laravel composer-php

我在Windows中使用xampp而我的PHP版本是5.5.15。 需要安装composer for Start使用laravel框架。但我的问题在这里,当我想安装composer时,面对这个错误:

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.

我该怎么办? 有没有办法在不使用作曲家的情况下安装laravel?

3 个答案:

答案 0 :(得分:1)

您基本上必须将环境变量SSL_CERT_FILE设置为从以下链接下载的ssl-certificate的PEM文件的路径:http://curl.haxx.se/ca/cacert.pem

我花了很多时间来解决这个问题。

有关详细答案,您可以在此处查看:https://stackoverflow.com/questions/34590842/cannot-install-composer-on-mac-os-x

答案 1 :(得分:0)

因为您尚未在计算机中安装SSL证书。

首先,您应该下载全球SSL证书:

wget http://curl.haxx.se/ca/cacert.pem

然后,通过在其后面添加以下行来更新 php.ini 文件:

openssl.cafile=/anywhere-you-like/cacert.pem
祝你好运!

答案 2 :(得分:0)

如果您使用的是卡巴斯基,请尝试禁用 加密连接扫描(或根据保护组件的要求设置扫描加密连接选项),然后重试。

enter image description here

enter image description here

如果您具有始终扫描加密的连接,则可能会收到以下错误消息:

[Composer\Downloader\TransportException]
  The "https://packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
  error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
  Failed to enable crypto
  failed to open stream: operation failed



[RuntimeException]
  Failed to clone https://github.com/doctrine/inflector.git via https, ssh protocols, aborting.
  - https://github.com/doctrine/inflector.git
    Cloning into 'C:\Users\User\my-project\vendor\doctrine\inflector'...
    fatal: unable to access 'https://github.com/doctrine/inflector.git/': SSL certificate problem: self signed certificate in certificate chain
  - git@github.com:doctrine/inflector.git
    Cloning into 'C:\Users\User\my-project\vendor\doctrine\inflector'...
    Host key verification failed.
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.