Composer不下载

时间:2016-02-24 16:53:22

标签: php proxy composer-php

我安装了作曲家,一切正常。当我运行composer -V时,我收到关于Xdebug的警告。

You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Composer version 1.0-dev (4c0e163977f8289288df7b37e0fd0469d3e8cbc6) 2016-02-20 19:28:03

我尝试使用composer require slim/slim "^3.0"安装Slim Framework并收到以下错误:

Loading composer repositories with package information                                                                               
  [Composer\Downloader\TransportException]                                     
  The "https://packagist.org/packages.json" file could not be downloaded: SSL  
  : Connection reset by peer                                                   
  Failed to enable crypto                                                      
  failed to open stream: operation failed

我不确定,但认为问题是代理,所以我尝试了提出的解决方案herehere

export HTTP_PROXY="http://127.0.0.1:3128"
export HTTP_PROXY_REQUEST_FULLURI=0 
export HTTPS_PROXY_REQUEST_FULLURI=0

仍然无效。我还在GitHub上找到了this closed issue,但一切正常。

以下是composer diag的结果:

You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Checking composer.json: FAIL
No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.
Checking platform settings: FAIL
The xdebug extension is loaded, this can slow down Composer a little.
 Disabling it when using Composer is recommended.

Checking git settings: OK
Checking http connectivity to packagist: FAIL
[Composer\Downloader\TransportException] The "http://packagist.org/packages.json" file could not be downloaded (HTTP/1.1 502 Proxy Error ( The URL does not use a recognized protocol. There is no support for the protocol or application not )
Checking https connectivity to packagist: FAIL
[Composer\Downloader\TransportException] The "https://packagist.org/packages.json" file could not be downloaded: SSL: Connection reset by peer
Failed to enable crypto
failed to open stream: operation failed
Checking HTTP proxy: FAIL
[Composer\Downloader\TransportException] The "https://packagist.org/packages.json" file could not be downloaded: SSL: Connection reset by peer
Failed to enable crypto
failed to open stream: operation failed
Checking HTTP proxy support for request_fulluri: FAIL
Unable to assess the situation, maybe packagist.org is down (The "http://packagist.org/packages.json" file could not be downloaded (HTTP/1.1 502 Proxy Error ( O URL não usa um protocolo reconhecido. Não há suporte para o protocolo ou a solicitação não ))
Checking HTTPS proxy support for request_fulluri: FAIL
Unable to assess the situation, maybe github is down (The "https://api.github.com/repos/Seldaek/jsonlint/zipball/1.0.0" file could not be downloaded: SSL: Connection reset by peer
Failed to enable crypto
failed to open stream: operation failed)
Checking github.com rate limit: FAIL
[Composer\Downloader\TransportException] The "https://api.github.com/rate_limit" file could not be downloaded: SSL: Connection reset by peer
Failed to enable crypto
failed to open stream: operation failed
Checking disk free space: OK
Checking pubkeys: 
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: 

  [Composer\Downloader\TransportException]                                     
  The "https://getcomposer.org/version" file could not be downloaded: SSL: Co  
  nnection reset by peer                                                       
  Failed to enable crypto                                                      
  failed to open stream: operation failed                                      


diagnose

还有什么我可以尝试的吗?

注意:

我的操作系统是Ubuntu 14.04,我正在使用CNTLM来处理Windows代理(TMG)。除了作曲家,一切正常(浏览器,apt-get,npm ......);

1 个答案:

答案 0 :(得分:1)

此错误是ssl错误,如果您的网络服务器是apache,而os是centos 7,您可以通过后续步骤修复它: 1.download http://curl.haxx.se/ca/cacert.pem并将其放入〜/ .cacert

2.add php.ini this

openssl.cafile= ~/.cacert/cacert.pem

3.Atartart you apache

systemctl restart httpd.service
希望能帮到你!