How to install cURL with HTTP/2 on Ubuntu 16.04

# apt

sudo apt-get install -y git g++ make binutils autoconf automake autotools-dev libtool pkg-config zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev libevent-dev libjansson-dev libjemalloc-dev cython python3-dev python-setuptools
sudo apt-get install -y libspdylay7 libspdylay-dev libspdylay-utils
sudo apt-get install -y gtk-doc-tools
sudo apt-get install -y libunistring-dev

# compile and install libmetalink

if [[ -d "$HOME/tmp/git/libmetalink" ]]; then
  cd "$HOME/tmp/git/libmetalink"
  git pull
else
  mkdir -p "$HOME/tmp/git"
  cd "$HOME/tmp/git"
  git clone "https://github.com/metalink-dev/libmetalink.git"
  cd "$HOME/tmp/git/libmetalink"
fi
make clean
make distclean
./buildconf
./configure --prefix=/usr/local
make
sudo make install
sudo ldconfig

# compile and install libpsl

if [[ -d "$HOME/tmp/git/libpsl" ]]; then
  cd "$HOME/tmp/git/libpsl"
  git pull
else
  mkdir -p "$HOME/tmp/git"
  cd "$HOME/tmp/git"
  git clone "https://github.com/rockdaboot/libpsl.git"
  cd "$HOME/tmp/git/libpsl"
fi
make clean
make distclean
./autogen.sh
./configure --prefix=/usr/local --enable-gtk-doc
make
sudo make install
sudo ldconfig

# compile and install nghttp2

if [[ -d "$HOME/tmp/git/nghttp2" ]]; then
  cd "$HOME/tmp/git/nghttp2"
  git pull
else
  mkdir -p "$HOME/tmp/git"
  cd "$HOME/tmp/git"
  git clone "https://github.com/tatsuhiro-t/nghttp2.git"
  cd "$HOME/tmp/git/nghttp2"
fi
make clean
make distclean
autoreconf -i
automake
autoconf
./configure --prefix=/usr/local
make
sudo make install
sudo ldconfig

# compile

mkdir -p "$HOME/tmp/tar_gz"
cd "$HOME/tmp/tar_gz"
if [[ ! -f "$HOME/tmp/tar_gz/curl-7.58.0.tar.gz" ]]; then
  wget -O "$HOME/tmp/tar_gz/curl-7.58.0.tar.gz" "http://curl.haxx.se/download/curl-7.58.0.tar.gz"
fi
tar xf "$HOME/tmp/tar_gz/curl-7.58.0.tar.gz"
cd "$HOME/tmp/tar_gz/curl-7.58.0"
make clean
make distclean
./configure --prefix=/usr/local --with-ssl --with-gssapi --with-libmetalink=/usr/local --with-libpsl=/usr/local --with-nghttp2=/usr/local
make

# install

sudo make install
sudo ldconfig

# service

sudo service php7.0-fpm restart
sudo service apache2 restart

1 comment

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.