作曲家安装失败

问题描述 投票:0回答:4

我想在我的Ubuntu 16.04PHP version 5.6.*安装作曲家。

我用:curl -sS https://getcomposer.org/installer | php。但它给我的错误,如下所示:

All settings correct for using Composer
Downloading...
The "https://getcomposer.org/versions" file could not be downloaded: failed to open stream: Connection refused
Retrying...
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
Retrying...
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
The download failed repeatedly, aborting.

我没有以前安装的作曲家。

php curl composer-php failed-installation
4个回答
2
投票

我通过下载https://curl.haxx.se/ca/cacert.pem,并给予它在我的etc/php/5.6/cli/php.inietc/php/5.6/apache2/php.ini路径解决问题。

然后运行sudo service apache2 restart && sudo apt install composer后刚刚工作的罚款。


1
投票

它看起来像PHP / OpenSSL的的主机上的配置错误。

我的工作站的Ubuntu 16.04.3,PHP 7.0.22和OpenSSL-1.0.2g - 安装工作的罚款。

尝试禁用TLS:

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

1
投票

开放端和运行php -r "var_dump(openssl_get_cert_locations());"

注意default_cert_file的位置。它可能会说\usr\local\ssl\cert.pem验证文件是否存在。如果不是,从https://curl.haxx.se/ca/cacert.pem下载cacert.pem文件,最好把它放在某处/usr/local/ssl

您现在有一个文件是usr/local/ssl/cacert.pem

打开你的php.ini,并添加文件openssl.cafile=cacert.pem的位置

安装作曲家

运行composer config --global cafile "/usr/local/ssl/cacert.pem"


0
投票

它是由我的卡巴斯基互联网安全造成我通过禁用KIS临时固定它

你可以试试看。


0
投票

我在使用Laravel家园后,我会不小心走光这个文件的内容,遇到这个问题:/etc/ssl/certs/ca-certificates.crt

什么固定对我来说是:

sudo apt-get purge ca-certificates 
sudo apt-get install ca-certificates

由于https://stackoverflow.com/a/53351370/470749

© www.soinside.com 2019 - 2024. All rights reserved.