Upgrade PHP 7.2.x to 7.4.x in centOS

Check PHP version before upgrading

php -v or php --version

Command to install the EPEL repository configuration package:
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Command to install the Remi repository configuration package:
yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm

Command to install the yum-utils package (for the yum-config-manager command):
yum install yum-utils

Command to enable the repository:
yum-config-manager --disable 'remi-php*'
yum-config-manager --enable remi-php74

You can check the list of the enabled repositories:
yum repolist

If an old version is installed, command to upgrade:
yum update

 

Check PHP version after upgrading

php -v or php --version

If no version is installed, command to install the php command:

    yum install php-cli