Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/267.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 编写器安装失败_Php_Curl_Composer Php_Failed Installation - Fatal编程技术网

Php 编写器安装失败

Php 编写器安装失败,php,curl,composer-php,failed-installation,Php,Curl,Composer Php,Failed Installation,我正试图用PHP版本5.6.*在我的Ubuntu 16.04中安装composer 我使用:curl-sShttps://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:

我正试图用PHP版本5.6.*在我的
Ubuntu 16.04
中安装composer

我使用:
curl-sShttps://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.

我以前没有安装composer。

这看起来像是主机上的PHP/openssl配置错误

我的工作站是Ubuntu 16.04.3、PHP7.0.22和openssl-1.0.2g——安装程序运行良好

尝试禁用TLS:

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

我通过下载并在
etc/php/5.6/cli/php.ini
etc/php/5.6/apache2/php.ini
中给出它的路径解决了这个问题


然后在运行
sudo服务apache2后重新启动&sudo-apt-install-composer
工作正常。

这是由我的卡巴斯基互联网安全造成的 我通过暂时禁用KIS修复了它


您可以尝试一下。

打开终端并运行
php-r“var\u dump(openssl\u get\u cert\u locations());”

注意
默认证书文件的位置
。它可能会说
\usr\local\ssl\cert.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“

我在使用Laravel Homestead时遇到了这个问题,因为我不小心清空了这个文件的内容:
/etc/ssl/certs/ca certificates.crt

为我解决的是:

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

由于

将导出代理从https更改为http

开放式终端

    echo $https_proxy
// Change export proxy from 
    https_proxy=https://192.168.0.10:8080/
// to 
   https_proxy=http://192.168.0.10:8080/

cmd::
https\u代理=http://192.168.0.10:8080/

我今天做不到。