How to Install PHP 7.2 in CentOS 7/Redhat ?

PHP 7.2

In this tutorial, we are discussing how to install PHP 7.2  in centos why because some of the applications like Magento needs a specific PHP version properly to install the setup or feature.

1. We have to install and enable EPEL and Remi repository to your CentOS 7 in order to install PHP 7.2

yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

2. Next, we need to install yum-utils, it is a collection of useful programs for managing yum repositories and packages.

yum install yum-utils

3. we have to enable Remi repository as the default repository for installing PHP 7.2

yum-config-manager --enable remi-php72

4. Now install PHP 7.1 with all necessary modules with the command below.

yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo

5. At last Check the php Version

php -v

 

Leave a Reply

Your email address will not be published. Required fields are marked *