我突然在使用 PHP Composer 时遇到了这个令人讨厌的 HTTPS 错误,而 Composer 曾经在我的机器上工作。 Github 和 stackoverflow 上已经有存在相同问题的主题。我尝试了所有推荐的东西,但没有任何对我有用。我下载了一个新证书并将其放入/usr/lib/ssl/certs
更新了PHP
更新了作曲家
没有问题curl
卷曲 https 页面。
php modules
:
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());
output:
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
错误信息:
[Composer\Downloader\TransportException]
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 文件
{
"name": "root/helloworld",
"require": {
"doctrine/orm": "~2",
"zendframework/zendframework": "^3.0"
},
"authors": [
{
"name": "23232323"
}
]
}
作曲家输出端子composer diagnose
:
composer diagnose
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: WARNING
[Composer\Downloader\TransportException] 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