在Mac上安装Composer时出现警告 [英] Warning while installing Composer on a Mac

查看:925
本文介绍了在Mac上安装Composer时出现警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Mac有OpenSSL版本1.0.1t,但当我尝试安装Composer时,我得到了错误

My Mac has OpenSSL version 1.0.1t, but when I tried to install Composer, I got an error:


您的计算机上的某些设置可能会导致Composer出现稳定性问题。
如果遇到问题,请尝试更改以下内容:

Some settings on your machine may cause stability issues with Composer. If you encounter issues, try to change the following:

PHP使用的OpenSSL库(0.9.8zc)不支持TLSv1.2或TLSv1。 1。
如果可能,您应该将OpenSSL升级到版本1.0.1或更高版本。

The OpenSSL library (0.9.8zc) used by PHP does not support TLSv1.2 or TLSv1.1. If possible you should upgrade OpenSSL to version 1.0.1 or above.

如何解决这个可能的稳定性问题?

How can I resolve this possible stability issue?

推荐答案

您安装的OpenSSL二进制文件的版本并不重要,重要的细节是PHP编译的版本。

The version of the OpenSSL binary that you have installed doesn't matter, the important detail is the version that PHP was compiled with.

听起来你正在使用OS X附带的PHP版本;您可以使用命令 php -i |来确认grep OpenSSL 并查找此输出:

It sounds like you are using the version of PHP shipped with OS X; you can confirm this by using the command php -i | grep OpenSSL and looking for this output:

OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 0.9.8zh 14 Jan 2016
OpenSSL Header Version => OpenSSL 0.9.8zc 19 Mar 2015
OpenSSL support => enabled

您需要自行安装较新版本的PHP,我建议使用套件管理系统,例如 MacPorts HomeBrew 安装这样的东西。

You'll need to install a newer version of PHP yourself instead of using the shipped version. I'd suggest a package management system like MacPorts or HomeBrew to install anything like this.

我没有HomeBrew的经验,但MacPorts将自动获取所需的所有库和依赖的最新版本,而不使用内置的。初始设置是一个痛苦,涉及安装XCode,但一旦完成,它很容易安装所需的所有软件,并保持最新。我的输出,例如,看起来像这样:

I have no experience with HomeBrew, but MacPorts will automatically fetch the latest versions of all the libraries and dependencies it needs, and not use the built-in ones. Initial setup is a pain and involves installing XCode, but once that's done it's easy to install all the software you need, and keep it up to date. My output, for example, looks like this:

SSL Version => OpenSSL/1.0.2h
OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 1.0.2h  3 May 2016
OpenSSL Header Version => OpenSSL 1.0.2h  3 May 2016
OpenSSL support => enabled

这篇关于在Mac上安装Composer时出现警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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