“ https://packagist.org/packages.json”无法下载文件:SSL操作失败 [英] The "https://packagist.org/packages.json" file could not be downloaded: SSL operation failed

查看:119
本文介绍了“ https://packagist.org/packages.json”无法下载文件:SSL操作失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

When I run the following command  




sudo作曲家更新

sudo composer update



then I am getting following error.




https://packagist.org/packages.json 文件无法下载
:SSL操作失败,代码为1。OpenSSL错误
消息:

错误:140770FC:SSL例程:SSL23_GET_SERVER_HELLO:未知协议

无法启用加密

无法打开流:操作失败

The "https://packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
Failed to enable crypto
failed to open stream: operation failed


推荐答案

在使用Homebrew升级到PHP 7.0.12之后,我在OSX上遇到了这个问题。

I came across this issue on OSX after using Homebrew to upgrade to PHP 7.0.12.

要解决该问题,我使用WGET下载了 cacert.pem

To resolve the problem I downloaded cacert.pem using WGET.

wget http://curl.haxx.se/ca/cacert.pem

我将该文件保存到我的主目录 /Users/alex/cacert.pem 。然后将我的PHP.ini文件配置为指向该证书位置。

I saved that file to my home directory /Users/alex/cacert.pem. Then configured my PHP.ini file to point to that cacert location.

要执行此操作;首先找到您的 php.ini 并运行 php --ini 命令,该命令将产生:

To do this; First locate your php.ini and run the command php --ini that should produce:

$ php --ini
Configuration File (php.ini) Path: /usr/local/etc/php/7.0
Loaded Configuration File:         /usr/local/etc/php/7.0/php.ini
Scan for additional .ini files in: /usr/local/etc/php/7.0/conf.d

要编辑的INI文件是位于加载的配置文件位置的文件。在您选择的编辑器(Vim等)中打开该文件,然后找到设置 openssl.cafile 。这可能已被注释掉,所以取消注释,然后插入您的 cacert.pem 的位置。

The INI file to edit is the one at the Loaded Configuration File location. Open that file in your editor of choice (Vim, etc) and find the setting openssl.cafile. This is probably commented out so uncomment it and insert the location of your cacert.pem.

您应该能够运行撰写安装撰写者更新撰写者自我更新

这篇关于“ https://packagist.org/packages.json”无法下载文件:SSL操作失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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