How to install PHP 7.2 on CentOS 7/RHEL 7

How to install PHP 7.2 on CentOS 7/RHEL 7

To install PHP 7.2, a popular open-source scripting language, on CentOS 7 or Red Hat Enterprise Linux (RHEL) 7, follow these steps:

  1. Add the PHP 7.2 package repository to your system's package sources by running the following command:
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
Sour‮w:ec‬ww.lautturi.com
  1. Enable the PHP 7.2 repository by running the following command:
sudo yum-config-manager --enable remi-php72
  1. Install PHP 7.2 by running the following command:
sudo yum install php

This will install PHP 7.2 and any dependencies required.

  1. To verify that the installation was successful, run the following command:
php -v

This will display the version of PHP that was installed.

  1. Optionally, you can install additional PHP modules by running the following command:
sudo yum install php-<module>

Replace <module> with the name of the module you want to install.

That's it! PHP 7.2 is now installed on your CentOS 7 or RHEL 7 system. You can use it to run PHP scripts and build web applications.

Created Time:2017-10-16 14:38:48  Author:lautturi