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

编程入门 行业动态 更新时间:2024-10-25 10:31:06
本文介绍了无法使用PHP 5.6.3与Composer建立SSL连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

使用PHP 5.6.3在Ubuntu 14.04上克隆存储库后,我无法运行 php composer.phar selfupdate php composer.phar update 。我收到此消息:

[Composer\Downloader\TransportException] https:// getcomposer。 org / version文件无法下载:SSL ope ration失败与代码1. OpenSSL错误消息:错误:14090086:SSL例程:SSL3_GET_SERVER_CERTIFICATE:证书验证失败无法启用crypto 无法打开流:操作失败

我认为问题应该是

这里是composer.json:

{name:zendframework / skeleton-application,description:Skeleton Application for ZF2,license:BSD-3-Clause,keywords:[framework,zf2],homepage :framework.zend/,require:{php:> = 5.3.3,zendframework / zendframework 2.3。*,evandotpro / edp-module-layouts:1. *,tecnick/tcpdf:~6.0@stable, phpunit / phpexcel:1.7。*},require-dev:{phpunit / phpunit:4.1。 phpunit-selenium:> = 1.2},autoload:{psr-0:{BOZA\\:vendor / BOZA / },classmap:[vendor / tecnick / tcpdf] }

<其中一个原因可能是PHP缺少或找不到证据。

code> ca-certificates 包安装?

如果没有: apt-get install ca-certificates 或只需从这里下载证书包:

  • curl.haxx.se /ca/cacert.pem
  • github/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- crt

After cloning a repository on Ubuntu 14.04 with PHP 5.6.3 I am unable to run php composer.phar selfupdate neither php composer.phar update. I get this message:

[Composer\Downloader\TransportException] The "getcomposer/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

I think the issue should be with the certificates that I have locally, but I can't imagine how to fix it.

Here is the composer.json:

{ "name": "zendframework/skeleton-application", "description": "Skeleton Application for ZF2", "license": "BSD-3-Clause", "keywords": [ "framework", "zf2" ], "homepage": "framework.zend/", "require": { "php": ">=5.3.3", "zendframework/zendframework": "2.3.*", "evandotpro/edp-module-layouts": "1.*", "tecnick/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/tcpdf"] }

解决方案

One cause of this might be that certs are missing or not found by PHP.

Is the ca-certificates package installed?

If not: apt-get install ca-certificates or simply download the certificate bundle from here:

  • curl.haxx.se/ca/cacert.pem
  • github/bagder/ca-bundle/blob/master/ca-bundle.crt

Then check and edit your php.ini, so that these certs are used for the SSL connection made by PHP.

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

更多推荐

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

本文发布于:2023-11-15 04:43:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1591252.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:PHP   SSL   Composer

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!