本帖最后由 gaoxu529 于 2024-10-25 23:51 编辑
目前通过以下步骤已解决。
1. 获取punum ,后面要用到
- cat /proc/cpuinfo |grep "processor"|wc -l
复制代码
2. 下载nghttp2 源码
- wget -O nghttp2-1.42.0.tar.gz https://github.com/nghttp2/nghttp2/archive/refs/tags/v1.42.0.tar.gz
复制代码
3. 编译nghttp2
- tar -zxf nghttp2-1.42.0.tar.gz
- cd nghttp2-1.42.0
- rm -rf /usr/local/nghttp2
- autoreconf -i
- automake
- autoconf
- ./configure --prefix=/usr/local/nghttp2
- make clean
- make -j ${cupnum}
- make install
复制代码
4、下载curl源码
- wget https://download.bt.cn/src/curl-7.70.0.tar.gz
复制代码
5、编译curl
- 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/nghttp2
- make -j${cpunum}
- make install
复制代码
6、卸载并重新安装php
完整脚本- #!/bin/bash
- # 获取CPU核数
- cpunum=$(cat /proc/cpuinfo | grep "processor" | wc -l)
- echo "CPU 核数:$cpunum"
- # 下载 nghttp2 源码
- echo "正在下载 nghttp2 源码..."
- wget -O nghttp2-1.42.0.tar.gz https://github.com/nghttp2/nghttp2/archive/refs/tags/v1.42.0.tar.gz
- # 解压并编译安装 nghttp2
- echo "解压 nghttp2 源码..."
- tar -zxf nghttp2-1.42.0.tar.gz
- cd nghttp2-1.42.0
- echo "准备编译和安装 nghttp2..."
- rm -rf /usr/local/nghttp2
- autoreconf -i
- automake
- autoconf
- ./configure --prefix=/usr/local/nghttp2
- make clean
- echo "编译 nghttp2 中..."
- make -j "$cpunum"
- make install
- echo "nghttp2 安装完成!"
- cd ..
- # 下载 curl 源码
- echo "正在下载 curl 源码..."
- wget https://download.bt.cn/src/curl-7.70.0.tar.gz
- # 解压并编译安装 curl
- echo "解压 curl 源码..."
- tar -zxf curl-7.70.0.tar.gz
- cd curl-7.70.0
- echo "准备编译和安装 curl..."
- rm -rf /usr/local/curl
- ./configure --prefix=/usr/local/curl --enable-ares --without-nss --with-ssl=/usr/local/openssl --with-nghttp2=/usr/local/nghttp2
- echo "编译 curl 中..."
- make -j "$cpunum"
- make install
- echo "curl 安装完成!"
- # 清理下载的压缩包
- echo "清理下载的压缩包..."
- rm -f nghttp2-1.42.0.tar.gz curl-7.70.0.tar.gz
- echo "所有操作已完成,nghttp2 和 curl 安装成功!"
复制代码
|