加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

无法使用PHP 5.6.3与Composer建立SSL连接

发布时间:2020-12-13 13:34:56 所属栏目:PHP教程 来源:网络整理
导读:在使用 PHP 5.6.3在Ubuntu 14.04上克隆存储库后,我无法运行php composer.phar selfupdate,也无法运行php composer.phar update.我收到这条消息: [ComposerDownloaderTransportException] The "https://getcomposer.org/version" file could not be downlo
在使用 PHP 5.6.3在Ubuntu 14.04上克隆存储库后,我无法运行php composer.phar selfupdate,也无法运行php composer.phar update.我收到这条消息:
[ComposerDownloaderTransportException]                                     
  The "https://getcomposer.org/version" file could not be downloaded: SSL ope  
  ration 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

我认为问题应该是我本地的证书,但我无法想象如何解决它.

这是composer.json:

{
"name": "zendframework/skeleton-application","description": "Skeleton Application for ZF2","license": "BSD-3-Clause","keywords": [
    "framework","zf2"
],"homepage": "http://framework.zend.com/","require": {
    "php": ">=5.3.3","zendframework/zendframework": "2.3.*","evandotpro/edp-module-layouts": "1.*","tecnick.com/tcpdf": "~6.0@stable","phpoffice/phpexcel": "1.7.*"
},"require-dev": {
    "phpunit/phpunit": "4.1.*","phpunit/phpunit-selenium": ">=1.2"
},"autoload": {
    "psr-0": {"BOZA": "vendor/BOZA/"},"classmap": ["vendor/tecnick.com/tcpdf"]
}
造成这种情况的一个原因可能是PHP丢失或找不到证书.

是否安装了ca-certificates软件包?

如果不是:apt-get install ca-certificates或者只是从这里下载证书包:

> http://curl.haxx.se/ca/cacert.pem
> https://github.com/bagder/ca-bundle/blob/master/ca-bundle.crt

然后检查并编辑php.ini,以便这些证书用于PHP建立的SSL连接.

curl.cainfo=/path/to/ssl/certs/ca-bundle.crt
openssl.cafile=/path/to/ssl/certs/ca-bundle.crt

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读