如何在MAMP中升级OpenSSL [英] How to upgrade OpenSSL in MAMP

查看:406
本文介绍了如何在MAMP中升级OpenSSL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mac OS X 10.6.8上使用MAMP 2.1-这是PHP的OpenSSL扩展随附的,但是只有版本0.9-我需要将其升级到1.0-但是我不确定如何处理一个任务.有人可以帮忙吗?

I am using MAMP 2.1 on Mac OS X 10.6.8 - This comes with the OpenSSL extention for PHP, however only version 0.9 - I need to upgrade it to 1.0 - however I'm not sure how I would go about such a task. Can anybody help?

推荐答案

您可以按照以下说明进行操作 我从此处

You can follow these instructions I got it from here

升级步骤

1)确保已安装XCode命令行工具.

我们将需要C编译器和其他库来升级cURL. 因此,启动一个终端,您将继续在其中的每个步骤中使用该终端 该文档.

We are going to need a C compiler and other libraries to upgrade cURL. So fire up a Terminal which you will continue to use for each step in this documentation.

xcode-select --install

2)安装Homebrew的OpenSSL库

目标是针对cURL提供的OpenSSL库编译cURL http://brew.sh ,因此,如果尚未安装自制软件,请按照以下步骤操作: 他们网站上的说明,或谨慎运行以下命令:

The goal is to compile cURL against the OpenSSL library offered by http://brew.sh, so if you do not have homebrew installed yet, follow the instructions on their website or, with caution, run this command:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

接下来,安装OpenSSL库:

Next, install the OpenSSL library:

brew install openssl

3)检查MAMP随附的cURL版本

我们只想确认我们使用的是哪个版本的cURL,因为我们 想要从官方cURL下载并安装相同版本 网站haxx.se

We just want to confirm which version of cURL we are using because we want to download and install the same version from the official cURL website, haxx.se

/Applications/MAMP/Library/bin/curl-config --version
The command should return with version 7.43.0

在完成下一步之前,请确保退出MAMP!

Make sure to quit MAMP before completing the next steps!

4)下载cURL源

从以下网址的官方网站下载cURL的源代码: curl.haxx.se/下载或直接获取:

Download cURL's source code from the official site at curl.haxx.se/download or fetch it directly:

cd ~/Downloads
wget https://curl.haxx.se/download/curl-7.43.0.tar.gz

接下来,将压缩包和cd解压缩到工作目录中

Next, extract the tarball and cd into the working directory

tar xzvf curl-7.43.0.tar.gz
cd curl-7.43.0

5)下载CA/证书包并解压缩到MAMP

cURL不附带任何CA文件或捆绑软件.你可以 找到您自己的来源,或从此处下载ca-bundle.tgz文件 存储库( https://github.com/lunr/mamp-curl-tls )和提取成 MAMP:

cURL by default does not come with any CA files or bundles. You can find your own source, or download the ca-bundle.tgz file from this repository (https://github.com/lunr/mamp-curl-tls) and extract into MAMP:

tar xzvf ca-bundle.tgz -C /Applications/MAMP

6)编译cURL

在以下目录的工作目录中执行以下configure命令 cURL源代码:

Execute the following configure command in the working directory of the cURL source code:

./configure --prefix=/Applications/MAMP/Library --with-ssl=/usr/local/Cellar/openssl/1.0.2g --with-ca-path=/Applications/MAMP/etc/openssl/certs --with-ca-bundle=/Applications/MAMP/etc/openssl/certs/ca-bundle.crt

此命令是专门为针对自制软件而构建的 OpenSSL库和您在步骤5中下载的CA捆绑软件.您可以 如果需要,可以添加自己的选项.

This command is written specifically to build against homebrew's OpenSSL library and the CA bundle you downloaded in step 5. You can add your own options if you wish.

命令完成后,您应该获得与输出完全相同的输出 这个:

Once the command is complete, you should have output exactly like this:

curl version:     7.43.0
Host setup:       x86_64-apple-darwin15.4.0
Install prefix:   /Applications/MAMP/Library
Compiler:         gcc
SSL support:      enabled (OpenSSL)
SSH support:      no      (--with-libssh2)
zlib support:     enabled
GSS-API support:  no      (--with-gssapi)
TLS-SRP support:  enabled
resolver:         default (--enable-ares / --enable-threaded-resolver)
IPv6 support:     enabled
Unix sockets support: enabled
IDN support:      no      (--with-{libidn,winidn})
Build libcurl:    Shared=yes, Static=yes
Built-in manual:  enabled
--libcurl option: enabled (--disable-libcurl-option)
Verbose errors:   enabled (--disable-verbose)
SSPI support:     no      (--enable-sspi)
ca cert bundle:   /Applications/MAMP/etc/openssl/certs/ca-bundle.crt
ca cert path:     /Applications/MAMP/etc/openssl/certs
LDAP support:     enabled (OpenLDAP)
LDAPS support:    enabled
RTSP support:     enabled
RTMP support:     no      (--with-librtmp)
metalink support: no      (--with-libmetalink)
HTTP2 support:    disabled (--with-nghttp2)
Protocols:        DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS LDAP LDAPS POP3 POP3S RTSP SMB SMBS SMTP SMTPS TELNET TFTP

具体来说,查看以下行:Install prefix和ca cert path和ca 证书捆绑包,并确认它们指向MAMP的目录.

Specifically, review the lines Install prefix and ca cert path and ca cert bundle and confirm they are pointing to MAMP's directory.

如果是,请继续,否则,有关配置的某些信息不正确 命令

If so, continue, else, something was incorrect about the configure command

7)安装新的cURL库

make && make install

8)重新启动MAMP并确认OpenSSL版本

打开MAMP应用程序并启动服务器.您可以使用phpinfo() 确认phpinfo()的curl部分下的OpenSSL版本.它 应该阅读SSL版本:OpenSSL/1.0.2g

Open the MAMP application and start the servers. You can use phpinfo() to confirm the OpenSSL version under the curl section of phpinfo(). It should read SSL Version: OpenSSL/1.0.2g

这篇关于如何在MAMP中升级OpenSSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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