1安装nghttp2
源码位置:https://github.com/nghttp2/nghttp2.git
编译步骤:
$ autoreconf -i
$ automake
$ autoconf
$ ./configure
$ make
$ make install
在目录 /etc/ld.so.conf添加动态库
touch /etc/ld.so.conf.d/nghttp2.conf 创建该文件
/usr/local/lib 添加路径
更新配置文件,执行ldconfig
* python最低版本为3.8,所以需要安装高版本python
1.1安装python3
源码位置:https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgz
tar -xzf Python-3.9.0.tgz
./configure --prefix=/usr/local/python3
make && make install
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
2安装高版本curl
源码位置:https://curl.se/download/curl-7.77.0.tar.gz
tar -xzf curl-7.77.0.tar.gz
./configure --with-nghttp2=/usr/local --with-ssl
make
查看版本信息:
===========以上编译成功 =========
用法具体
../curl-7.77.0/src/curl --http2 -skvo /dev/null "https://www.sina.com"