To install PHP 7.2 on CentOS 7/RHEL 7, follow these steps:
- Add the remi repository:
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
- Enable the remi-php72 repository:
sudo yum-config-manager --enable remi-php72
- Install PHP 7.2 and its dependencies:
sudo yum install php72
- Verify the installation by checking the version of PHP:
php -v
This should display the version of PHP 7.2 installed on your system.