How to upgrade php-curl from 7.19.7 to 7.36.0 on CentOS
You are currently running PHP cURL version 7.19.7 on a CentOS server, and your requirement is to jump directly to version 7.36.0. Your initial attempt used the standard package manager command:
yum update php-curl
The output indicates that no packages were marked for an update. This behavior is typical for CentOS when using the default repositories. The yum client checks the local metadata against the enabled repositories (usually base, updates, and potentially epel). If version 7.36.0 is not present in those specific repositories, yum will simply report that nothing needs updating. It does not automatically pull packages from third-party archives or perform a manual installation of a specific RPM unless explicitly told to do so via the download-only plugin logic, which you observed in your output.
The version disparity between 7.19.7 and 7.36.0 is significant. Version 7.19.7 was released in 2014, while 7.36.0 is a modern release from the mid-2020s. This gap implies that your current system lacks critical security patches, TLS protocol support updates (such as proper handling of newer cipher suites), and likely missing support for new HTTP/2 features or improved SSL/TLS certificate verification mechanisms found in modern cURL builds.
To achieve this specific upgrade target on CentOS, you must bypass the standard distribution packaging if that version is not available in your base or updates stream. The most direct method to install a specific cURL binary linked against a specific PHP build involves compiling from source or utilizing a third-party repository like Remi's repository (remi), which often provides newer PHP and PECL extensions than the standard CentOS repositories.
Compiling from Source for Specific Version Requirements
If you require exactly version 7.36.0 and it is not available as a pre-built RPM in your current repo configuration, compiling cURL from source is the most reliable path to ensure binary compatibility with your existing PHP installation.
First, install the necessary compilation dependencies:
sudo yum install -y curl-devel openssl-devel libcurl-devel gcc make autoconf zlib-devel
Next, download the specific version 7.36.0 release tarball from the official cURL website. Navigate to the source directory and extract the archive:
cd /usr/src
wget https://github.com/curl/curl/archive/refs/tags/curl-7_36_0.tar.gz
tar xvf curl-7_36_0.tar.gz
cd curl-7_36_0
Configure, build, and install the library. It is crucial to ensure that the --enable-libssh2 or other optional features match your application's requirements, as mismatched dependencies can cause runtime errors when PHP cURL tries to use specific protocols.
./configure --prefix=/usr/local/curl-7.36.0 --disable-static
make
sudo make install
Once the C library is installed, you must rebuild the PHP extension or recompile your PHP binary to link against this new cURL library. If you are using PECL to install the curl extension:
- Ensure your
php.inipoints to the correct cURL include path if you modified the prefix. - Run
pecl uninstall curlfollowed bypecl install curlafter ensuring the new headers and libraries are in the system path (/usr/local/curl-7.36.0/lib).
Alternatively, if you are recompiling PHP itself, you must pass the correct library paths during the PHP build configuration step to link against /usr/local/curl-7.36.0/lib/libcurl.so.
Using Remi Repository as an Alternative
If compiling from source introduces complexity regarding header mismatches or linker errors, installing a pre-built package from Remi's repository is often the preferred production strategy on CentOS/RHEL systems. Remi provides newer versions of PHP and its extensions that are not yet in the standard CentOS repos.
Enable the remi repo and install the specific version if available:
sudo yum install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
sudo yum-config-manager --enable remi-php74
sudo yum update php-curl
Note: The availability of version 7.36.0 specifically in Remi's repository depends on the base PHP version (e.g., PHP 5.6, 7.0, etc.) you are targeting. Modern cURL versions usually require PHP 5.5+ or PHP 7+. If your current PHP version is too old to support the cURL API changes in 7.36.0, you will need to upgrade PHP itself alongside cURL.
Verification and Pitfalls
After installation, verify the upgrade by checking the runtime version:
php -m | grep curl
# or specifically
curl --version
Ensure that libcurl in your system path matches the installed binary. A common pitfall is having multiple cURL libraries installed (system-wide vs. local). If PHP is linked against an older system library while you installed a newer one, you might see version 7.36.0 headers but runtime errors indicating an older library version. Check /etc/ld.so.conf.d/ and your LD_LIBRARY_PATH to ensure the new library is prioritized.
Finally, test connectivity with a modern SSL endpoint to confirm that TLS handshake protocols are functioning correctly:
curl -v --tlsv1.2 https://www.google.com
If this command fails, your cURL build might be missing OpenSSL 1.x support or specific TLS libraries required for the newer security standards.