curl 支持 HTTP2

源码安装
安装 nghttp2

cd /usr/local/src 
wget https://github.com/nghttp2/nghttp2/releases/download/v1.40.0/nghttp2-1.40.0.tar.gz
tar xvf nghttp2-1.40.0.tar.gz && cd nghttp2-1.40.0
./configure && make && make install

升级openssl

cd /usr/local/src 
wget https://www.openssl.org/source/openssl-1.1.1d.tar.gz
tar xvf openssl-1.1.1d.tar.gz && cd openssl-1.1.1d
./config
make && make install
mv /usr/bin/openssl /usr/bin/openssl.bak
ln -s /usr/local/bin/openssl /usr/bin/openssl
ln -s /usr/local/include/openssl /usr/include/openssl
cp /usr/local/lib/libssl.so.1.1 /usr/lib/
cp /usr/local/lib/libcrypto.so.1.1 /usr/lib/
echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf

升级curl

cd /usr/local/src
wget https://curl.haxx.se/download/curl-7.69.1.tar.gz
tar xvf curl-7.69.1.tar.gz
cd curl-7.69.1
./configure --with-nghttp2=/usr/local --with-ssl
make && make install 
ldconfig

yum 安装
安装 yum 源

rpm -ivh http://mirror.city-fan.org/ftp/contrib/yum-repo/city-fan.org-release-2-1.rhel7.noarch.rpm

新建 yum 源(功能与 安装 yum 源 相同)

vim /etc/yum.repos.d/city-fan.repo

[cityfan]  
name=cityfan 
baseurl=http://www.city-fan.org/ftp/contrib/yum-repo/rhel7/x86_64/
enabled=1  
gpgcheck=0

更新curl

yum update curl

注意:
如果php 的curl 扩展支持系统的curl 库,重新编译php curl 扩展将--with-curl 指向系统curl安装路径或将系统新版本的libcurl.so.xxx模块拷贝到/usr/lib/xxxx