How to upgrade to PHP 8 on CentOS 7

In this tutorial I will show you how to upgrade to PHP version 8 on CentOS 7. Having the latest stable PHP 8 will fix many older vulnerabilities. Lets follow these quick steps below to upgrade your PHP version.

  1. Open your console windows and connect to your server.
  2. Lets start by disabling all the old PHP versions.
yum-config-manager --disable remi-php56
yum-config-manager --disable remi-php70
yum-config-manager --disable remi-php71
yum-config-manager --disable remi-php72
yum-config-manager --disable remi-php73
yum-config-manager --disable remi-php74

3. Lets run the following commands individually to download the PHP 8 packages we need.

rpm -Uvh remi-release-8.rpm epel-release-latest-8.noarch.rpm

4. We will now run the commands to install the latest PHP version 8 software.

yum install yum-utils
yum-config-manager --enable remi-php80
yum update -y

5. You should now be on the latest version of PHP 8. You can check your version by typing in php -v in the console window.

Leave a Reply