Cannot establish SSL connection with Composer with PHP 5.6.3(无法使用 PHP 5.6.3 与 Composer 建立 SSL 连接)
问题描述
使用 PHP 5.6.3 在 Ubuntu 14.04 上克隆存储库后,我无法运行 php composer.phar selfupdate
和 php composer.phar update
.我收到这条消息:
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:
[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
我认为问题应该与我在本地拥有的证书有关,但我无法想象如何解决它.
I think the issue should be with the certificates that I have locally, but I can't imagine how to fix it.
这是composer.json:
Here is the 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 找不到.
One cause of this might be that certs are missing or not found by PHP.
是否安装了 ca-certificates
包?
如果没有:apt-get install ca-certificates
或者直接从这里下载证书包:
If not: apt-get install ca-certificates
or simply download the certificate bundle from here:
- http://curl.haxx.se/ca/cacert.pem
- https://github.com/bagder/ca-bundle/blob/master/ca-bundle.crt
然后检查并编辑您的 php.ini
,以便这些证书用于 PHP 建立的 SSL 连接.
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 连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:无法使用 PHP 5.6.3 与 Composer 建立 SSL 连接
基础教程推荐
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 在多维数组中查找最大值 2021-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01