PHP Composer HTTPS error 1416F086. Certificate verifying failed(PHP Composer HTTPS 错误 1416F086.证书验证失败)
问题描述
我突然在使用 PHP Composer 时遇到了这个讨厌的 HTTPS 错误,而 Composer 曾经在我的机器上工作过.Github 和 stackoverflow 上已经有相同问题的主题.我尝试了所有推荐的方法,但对我没有任何作用.我下载了一个新证书并将其放入 /usr/lib/ssl/certs
I suddenly get this nasty HTTPS error with PHP Composer and Composer used to work on my machine. There are already topics with the same issue on Github and also stackoverflow. I tried everything what is recommended but nothing works for me. I downloaded a new certificate and put it into /usr/lib/ssl/certs
更新了 php
updated php
作曲家更新
curl
卷曲https页面没有问题.
There is no problem with curl
to curl a https page.
php 模块
:
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib
[Zend Modules]
Zend OPcache
我的系统:
Distributor ID: LinuxMint
Description: Linux Mint 18.2 Sonya
Release: 18.2
Codename: sonya
print_r(openssl_get_cert_locations());
输出:
Array ( [default_cert_file] => /usr/lib/ssl/cert.pem [default_cert_file_env] => SSL_CERT_FILE [default_cert_dir] => /usr/lib/ssl/certs [default_cert_dir_env] => SSL_CERT_DIR [default_private_dir] => /usr/lib/ssl/private [default_default_cert_area] => /usr/lib/ssl [ini_cafile] => /opt/atom/resources/app.asar.unpacked/node_modules/dugite/git/ssl/cacert.pem [ini_capath] => )
composer install
错误信息:
[ComposerDownloaderTransportException]
The "https://repo.packagist.org/packages.json" 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
我的简单 composer.json 文件
my simple composer.json file
{
"name": "root/helloworld",
"require": {
"doctrine/orm": "~2",
"zendframework/zendframework": "^3.0"
},
"authors": [
{
"name": "23232323"
}
]
}
Composer 输出终端 composer 诊断
:
Composer output terminal composer diagnose
:
composer diagnose
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: WARNING
[ComposerDownloaderTransportException] The "https://repo.packagist.org/packages.json" 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
Checking github.com rate limit: OK
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: OK
Composer version: 1.7.3
PHP version: 7.2.12
PHP binary path: /usr/bin/php7.2
推荐答案
我找到了解决这个问题的方法:
I found a solution for this problem:
sudo apt-get purge ca-certificates
sudo apt-get install ca-certificates
作曲家诊断
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
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: OK
Composer version: 1.7.3
PHP version: 7.2.12
PHP binary path: /usr/bin/php7.2
这篇关于PHP Composer HTTPS 错误 1416F086.证书验证失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:PHP Composer HTTPS 错误 1416F086.证书验证失败
基础教程推荐
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- 在多维数组中查找最大值 2021-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01