cUrl is a command line tool and library that is used for for transferring data with URLs. It is being used in a number of system tools in linux (ex. yum, apt), it is being used by the websites to communicate with public APIs (ex. PayPal) so it is important to keep it up to date to stay protected.
This article contains the instructions about the way to install the latest cUrl from source package on the CentOS server.
First of all we recommend to download the available rpm packages to have a restore point in case if something goes wrong. The easiest way to do this is to use yum-tools and download the packages from the software repository:
yumdownloader curl libcurl
Next lets install required packages:
cd /usr/local/src/ && tzr xf curl-7.50.3.tar.gz && cd curl-7.50.3
There are 2 options to proceed:
- If you'd like to have curl installed into isolated folder (ex. opt/curl) run the following configure command:
./configure --prefix=/opt/curl --with-ssl --with-libssh2 --with-zlib --with-nghttp2
- If you are going to replace the existing cUrl and have it installed into the default system folders, than run the following command (recommended)
./configure --prefix=/usr --with-ssl --with-libssh2 --with-zlib --with-nghttp2
If you decided to proceed with option #2 than you'll need to remove currently installed curl:
Now you can install upgraded package:
The package fails to be prepared with checkinstall so the only way at this point is to run make install.
You might need to recompile the software with the new libcurl but PHP works great with upgraded cUrl.