从 packagist 更新时,Composer 更新失败
在执行作曲家安装/更新时,我从openssl收到以下错误:
无法下载“https://packagist.org/packages.json”文件:SSL 操作失败,代码为 1。OpenSSL 错误消息:错误:14090086:SSL 例程:SSL3_GET_SERVER_CERTIFICATE:证书验证失败 无法启用加密无法打开流:操作失败 https://packagist.org 无法完全加载,包信息已从本地缓存加载,可能已过期
我正在使用:
- PHP 5.6.3 (cli) (建版本: Nov 17 2014 15:16:53)
- XAMPP 堆栈 5.6.3-0
- ubuntu 14.04
作曲家诊断显示:
Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity: FAIL
[Composer\Downloader\TransportException] The "https://packagist.org/packages.json" 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
Checking disk free space: OK
Checking composer version:
[Composer\Downloader\TransportException]
无法下载“https://getcomposer.org/version”文件:SSL 操作失败,代码为 1。OpenSSL 错误消息:错误:
14090086:SSL 例程:SSL3_GET_SERVER_CERTIFICATE:证书验证失败
启用加密
失败 无法打开流:操作失败
php -r 'var_dump(openssl_get_cert_locations());' 显示:
array(8) {
["default_cert_file"]=>
string(33) "/opt/lampp/share/openssl/cert.pem"
["default_cert_file_env"]=>
string(13) "SSL_CERT_FILE"
["default_cert_dir"]=>
string(30) "/opt/lampp/share/openssl/certs"
["default_cert_dir_env"]=>
string(12) "SSL_CERT_DIR"
["default_private_dir"]=>
string(32) "/opt/lampp/share/openssl/private"
["default_default_cert_area"]=>
string(24) "/opt/lampp/share/openssl"
["ini_cafile"]=>
string(0) ""
["ini_capath"]=>
string(0) ""
}
对于 php 5.5.19,一切都还行。