How to install PHP 7.2 on CentOS 7/RHEL 7

To install PHP 7.2 on CentOS 7/RHEL 7, follow these steps:

  1. 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
  1. Enable the remi-php72 repository:
sudo yum-config-manager --enable remi-php72
  1. Install PHP 7.2 and its dependencies:
sudo yum install php72
  1. Verify the installation by checking the version of PHP:
php -v

This should display the version of PHP 7.2 installed on your system.

Leave a Comment