如何在Linux / Mac中更新PHP curl扩展? [英] How to update PHP curl extension in Linux/Mac?

查看:1436
本文介绍了如何在Linux / Mac中更新PHP curl扩展?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在PHP中更新curl扩展的最简单的方法是什么?我在Mac / Linux上安装XAMPP,并注意到它不允许我使用HTTP2,所以我想使用 - with-nghttp2 选项编译自己的curl,但是如何将它包含到PHP?安装卷曲与

  brew安装curl --with-nghttp2 

在Mac上不改变任何在phpInfo(),PHP使用的curl版本保持与以前相同。



您可以在终端中输入 which curl 以检查系统默认CURL的位置。



键入 brew重新安装curl --with-openssl --with-nghttp2 在您的终端重新安装您的curl与openssl和nghttp2。 brew是很好的,因为它有助于解决openssl和nghttp2依赖。



我没有深入,但将这个curl复制到xampp库文件夹,替换CURL没有工作。什么工作是重新编译CURL https://curl.haxx.se/docs/install.html前缀是你的xampp库文件夹。点你的--with-openssl = [homebrew cellar openssl文件夹]和--with-nghttp2 = [homebrew cellar nghttp2文件夹]



抱歉的模糊的答案,得到一般的概念,不应该太难找出详细的步骤。


What is the easiest way to update the curl extension in PHP? I installed XAMPP on Mac/Linux and noticed that it doesn't allow me to use HTTP2, so I thought of compiling my own curl with the --with-nghttp2 option, but how can I include this into PHP? installing curl with

brew install curl --with-nghttp2

on Mac doesn't change anything in the phpInfo(), the curl version used by PHP remains the same as before.

解决方案

The reasons your phpinfo() doesn't update is because XAMPP's CURL and your terminal default CURL are two different CURLs. homebrew installs/updates your system default curl but not your XAMPP's curl.

you can type which curl in your terminal to check where your system default CURL is located.

Type brew reinstall curl --with-openssl --with-nghttp2 in your terminal to reinstall your curl with openssl and nghttp2. brew is nice because it helps settle the openssl and nghttp2 dependencies.

I didn't dig into it but copying this curl to the xampp library folder and replacing the CURL did not work. what worked was recompiled CURL https://curl.haxx.se/docs/install.html the prefix is your xampp library folder. point your --with-openssl=[homebrew cellar openssl folder] and --with-nghttp2=[homebrew cellar nghttp2 folder]

sorry for the vague answer but if you get the general concept it shouldn't be too hard to figure out the detailed steps.

这篇关于如何在Linux / Mac中更新PHP curl扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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