2

I installed composer and all works fine. When I run composer -V I just receive a warning about 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

I tried to install Slim Framework with composer require slim/slim "^3.0" and receive the following error:

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

I was not sure, but thought the problem was the proxy, so I tried the solutions proposed here and here.

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

Still does not work. I also found this closed issue on GitHub, but anything works.

Below are the result of 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

Are there anything else that I can try?

Notes:

My OS is Ubuntu 14.04 and I'm using CNTLM to deal with a Windows proxy (TMG). Except composer, everything is working fine (browser,apt-get,npm...);

Community
  • 1
  • 1
James
  • 1,653
  • 2
  • 31
  • 60
  • Ah! I had exactly the same problem a year ago, tried a lot of things at once, not sure which worked but involved updating some php settings regarding the certificates as well as downloading a cacert.pem from Mozilla – codisfy Feb 24 '16 at 17:07
  • 1
    Have a look at this it might help https://gyazo.com/ef952a13bbf04703033b70e66e60047a – codisfy Feb 24 '16 at 17:10
  • Thanks, but it does not work to me... – James Feb 24 '16 at 19:28

1 Answers1

2

This error is SSL error, if your webserver is Apache, and os is centos 7, you can fixed it by next steps:

  1. Download http://curl.haxx.se/ca/cacert.pem and put it in ~/.cacert

  2. Add php.ini this

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

  3. Restart your Apache

    systemctl restart httpd.service

Dharman
  • 30,962
  • 25
  • 85
  • 135