AngusWong's 博客

  • 首页
  • Linux
  • Mac
  • PHP
  • 数据库
  • 路由相关
专注于计算机相关技术分享
  1. 首页
  2. Linux
  3. 正文

重新编译PHP让宝塔面板curl支持http2

2021年2月2日 3180点热度 6人点赞 0条评论

由于宝塔面板默认的php编译的curl未加入http2的支持,如果服务需要使用apns推送等需要http2.0的访问就会失败,所以重新编译php让其支持http2.0

编译方法:

一、安装nghttp2

git clone https://github.com/tatsuhiro-t/nghttp2.git
cd nghttp2
autoreconf -i
automake
autoconf
./configure
make
make install
echo '/usr/local/lib' > /etc/ld.so.conf.d/custom-libs.conf
ldconfig
注意:新版本的nghttp2需要python3.8以上版本

如果系统未安装phthon3.8以上版本的,请先行安装,安装方法如下:

1、下载安装包(以python3.8.8为例)

wget https://www.python.org/ftp/python/3.8.8/Python-3.8.8.tgz
tar -zxvf  Python-3.8.8.tgz

2、编译安装Python

mkdir /usr/local/python3 #创建编译安装目录
cd Python-3.8.3
./configure --prefix=/usr/local/python3
make && make install

3、建立软链接,未完成这一步会找不到python3

#添加python3的软链接 
ln -s /usr/local/python3/bin/python3 /usr/bin/python

 

二、安装Curl

wget https://curl.haxx.se/download/curl-7.70.0.tar.gz
tar -zxf curl-7.70.0.tar.gz
cd curl-7.70.0
rm -rf /usr/local/curl
./configure --prefix=/usr/local/curl --enable-ares --without-nss --with-ssl=/usr/local/openssl --with-nghttp2=/usr/local
make
make install
cd ..
rm -f curl-7.70.0.tar.gz
rm -rf curl-7.70.0

安装完成后在宝塔后台重新编译PHP

标签: curl http2 linux 宝塔
最后更新:2021年3月9日

Sean

这个人很懒,什么都没留下

点赞
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复
分类
  • Linux
  • Mac
  • PHP
  • 其他
  • 前端
  • 数据库
  • 路由相关
最新 热点 随机
最新 热点 随机
macOS Sonoma, macOS Sequoia删除Mac启动台里删不掉的图标 PVE8修改软件仓库源和 CT模板(LXC)源为国内源 Debian12更换国内源 构建宝塔面板Docker镜像 无需root!卸载小米电视/盒子内置应用 检查系统是否被入侵
Docker:docker镜像与容器的导入和导出 MySql数据库备份与恢复——使用mysqldump 导入与导出 macOS Sonoma, macOS Sequoia删除Mac启动台里删不掉的图标 Vue混入mixin centos7 修改root和home的空间大小 使用宝塔面板安装的Gitlab更改配置

COPYRIGHT © 2021 huangyuqiang.cn. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang