How to Upgrade to PHP 7 on RHEL/CentOS

tl; DR = Upgrade to PHP 7 Using Remi’s RPM Repository – PHP Configuration Wizard,

Red Hat Enterprise Linux (RHEL) is a Linux distribution developed by Red Hat that is targeted towards the commercial market. Red Hat uses strict trademark rules to restrict free redistribution of its officially supported versions, but still provides its source code freely. third-party derivatives such as Centos Non-free components are created by disassembling and redistributing.

One of the main advantages of RHEL/CentOS is that they run only the most stable versions of packaged software. This greatly reduces the risk of accidents and errors. Users who install RHEL/CentOS also have access to years of enterprise-level security updates. All this stability and security comes with a few trade-offs. One of which is that newer software packages are less likely to be supported and in this case… PHP 7. RHEL/CentOS lacks official support for PHP 7, or PHP 5.6, which will shortly be available for EOL (Lifetime) end of). month. PHP 5.4 is available on the latest RHEL/CentOS 7, while RHEL/CentOS 6 supports the very, very slow PHP 5.3. These versions will be protected through RHEL’s security patches. Thus, unlike other distros, technically you don’t need to make that mad dash to upgrade to PHP 7.

ok i get it! I still want PHP 7 (speed!!) on my RHEL/CentOS server.

You’ve been warned, but you’ll still want to install the new PHP 7 packages on your rock solid RHEL/CentOS server. First of all, if you find yourself constantly forcing premature upgrades of multiple software packages on RHEL/CentOS, I would recommend you consider migrating fedora or other distros like Ubuntu,Debian, (Read: Best Linux Server Distros by Main Focus/Power)

However, if you’re only going to upgrade PHP and probably MySQL, you might want to stick with RHEL/CentOS for its stellar stability/security. That said, be aware that installing new software packages that are not yet officially supported makes your distro less stable and less secure. How little, will largely depend on you or your server admin.

Upgrade to PHP 7, you can use Fedora Extra Packages for Enterprise Linux (EPEL),
Follow the instructions given here:,
Alternatively, follow the guidance here:

Leave a Comment