从packagist更新时,Composer更新失败 [英] Composer update fails while updating from packagist

查看:4245
本文介绍了从packagist更新时,Composer更新失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

执行composer安装/更新时,我从openssl得到以下错误:

While executing composer install/update I have got the following error from openssl:


https://packagist.org/packages.json 无法下载文件:SSL操作失败,代码为1. OpenSSL错误消息:
错误:14090086:SSL例程:SSL3_GET_SERVER_CERTIFICATE:证书验证失败
无法启用crypto
无法打开流:操作失败
https://packagist.org 无法完全加载,软件包信息从本地缓存加载,可能已过期

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 https://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date

我使用的是:


  1. PHP 5.6.3(cli) :16:53)

  2. XAMPP协议栈5.6.3-0

  3. ubuntu 14.04

composer diag显示:

composer diag shows:

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:证书验证失败

无法启用加密

无法打开流:操作失败

[Composer\Downloader\TransportException]
The "https://getcomposer.org/version" 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

php -r'var_dump(openssl_get_cert_locations());'显示:

php -r 'var_dump(openssl_get_cert_locations());' shows:

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) ""
}

是好的。

推荐答案

我找到了一个解决方案

'm running:

FreeBSD 10.1

Apache2.4

PHP 5.6.3

I'm running:
FreeBSD 10.1
Apache2.4
PHP 5.6.3

找到CA文件我运行此命令

To find the CA file I ran this command

>找到cacert.pem

结果是:

/usr/local/lib/perl5/site_perl/5.16/Mozilla /CA/cacert.pem

Result was:
/usr/local/lib/perl5/site_perl/5.16/Mozilla/CA/cacert.pem

然后打开php.ini文件和

更改此:

Then open the php.ini file and
change this:


; openssl.cafile =

;openssl.cafile=

至此:


openssl.cafile = / usr / local / lib / perl5 / site_perl / 5.16 / Mozilla / CA / cacert.pem

openssl.cafile=/usr/local/lib/perl5/site_perl/5.16/Mozilla/CA/cacert.pem

注意:此指令仅适用于php 5.6.x

Note: This directive is only available on php 5.6.x

然后重新启动Apache

Then restart Apache

这篇关于从packagist更新时,Composer更新失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆