Error installing composer

0

I'm trying to install the composer and it gives the following error:

The Composer installer script was not successful [exit code 1].

OpenSSL failed with a 'certificate verify failed' error. This indicates a problem with the Certificate Authority file(s) on your system, which may be out of date.

Certificate location [from openssl.cafile ini setting]:
C:\xampp\apache\bin\cacert.pem

The php.ini used by your command-line PHP is: C:\xampp\php\php.ini

Script Output:
The "https://getcomposer.org/versions" 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

I have already tried changing the certificate in PHP.ini from

'openssl.cafile="C:\xampp\apache\bin\curl-ca-bundle.crt"'

for

openssl.cafile="C:\xampp\apache\bin\cacert.pem"

I've tried including PHP in the path. I'm using Xampp.

    
asked by anonymous 19.12.2018 / 13:15

1 answer

0

Your CA file does not have DigiCert certificates. Looking at the Composer site, in https://getcomposer.org/versions , the certificate was generated by DigiCert SHA2 Secure Server CA . Looking at the DigiCert website you get this CA in this https://dl.cacerts.digicert.com/DigiCertSHA2SecureServerCA.crt link. This should solve the problem.

    
19.12.2018 / 14:51