2016-02-04 6 views
1

При установке Composer на XAMPP у меня появились некоторые ошибки. Моя системная ОС была Windows 7, как я могу решить эту проблему и установить Composer?Ошибка SSL при установке 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.sig): 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.sig): failed to open stream: operation failed

ответ

2

Убедитесь, что вы настроили путь к сертификатам Ца в php.ini:

curl.cainfo=/full/path/to/ssl/certs/ca-bundle.crt 
openssl.cafile=/full/path/to/ssl/certs/ca-bundle.crt 

В случае, если вы не имеете пакет сертификатов CA загрузить:

https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt

Для установки Composer (без использования cURL):

php -r "readfile('https://getcomposer.org/installer');" | php

Или установить Composer (с Curl):

curl -sS https://getcomposer.org/installer | php 

(Если это не работает, просто скачать композитор ФАР с помощью вашего браузера.

https://getcomposer.org/composer.phar

Но, вы снова столкнетесь с вопросом, когда выборка пакетов, пока вы не решить проблему сертификата.)

+0

У меня есть скачать файл "ча-bundle.crt" "C: \ XAMPP \ PHP" это после того, что я добавить два файла php.ini строку, curl.cainfo = "C: \ XAMPP \ PHP \ ca-bundle.crt " openssl.cafile =" C: \ xampp \ php \ ca-bundle.crt ", после того, как я попытался установить ту же ошибку, придет, пожалуйста, помогите мне – ranjith

+1

@ranjith, вероятно, вам нужно перезагрузить служба Apache –

0

Это точно такая же проблема я столкнулся. При установке Composer установки на моей машине Windows 7 я получаю ошибку ниже:

The "https://getcomposer.org/versions" file could not be downloaded: 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 

Пробовал так:

$ curl -sS https://getcomposer.org/installer | php 
stdin is not a tty 
curl: (60) SSL certificate problem: self signed certificate in certificate chain 
More details here: https://curl.haxx.se/docs/sslcerts.html 

curl performs SSL certificate verification by default, using a "bundle" 
of Certificate Authority (CA) public keys (CA certs). If the default 
bundle file isn't adequate, you can specify an alternate file 
using the --cacert option. 
If this HTTPS server uses a certificate signed by a CA represented in 
the bundle, the certificate verification probably failed due to a 
problem with the certificate (it might be expired, or the name might 
not match the domain name in the URL). 
If you'd like to turn off curl's verification of the certificate, use 
the -k (or --insecure) option. 

И это:

$ ping getcomposer.org 

Pinging getcomposer.org [87.98.253.108] with 32 bytes of data: 
Reply from 87.98.253.108: bytes=32 time=137ms TTL=47 
Reply from 87.98.253.108: bytes=32 time=127ms TTL=47 
Reply from 87.98.253.108: bytes=32 time=127ms TTL=47 
Reply from 87.98.253.108: bytes=32 time=127ms TTL=47 

Ping statistics for 87.98.253.108: 
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), 
Approximate round trip times in milli-seconds: 
    Minimum = 127ms, Maximum = 137ms, Average = 129ms 

Мой PHP версия:

$ php -v 
PHP 5.5.37 (cli) (built: Jun 22 2016 16:14:46) 
Copyright (c) 1997-2015 The PHP Group 
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies 
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies 

У меня есть включен следующий список в моем php.ini:

extension=php_curl.dll 
extension=php_openssl.dll 
curl.cainfo="C:/xampp/php/extras/certs/cacert.pem" 
openssl.cafile="C:/xampp/php/extras/certs/cacert.pem" 

Где я скачал cacert.pem от https://curl.haxx.se/ca/cacert.pem

мне не хватает, чтобы добавить настройки прокси-сервера во время установки, при добавлении он работал как шарм! :)

http://username:[email protected]_proxy:your_port 
Смежные вопросы