Introduction
PHP is a server scripting language it stands for Hypertext Pre-processor. The PHP codes are executed on the server side whereas HTML codes are directly executed on the browser. it allows the creation of dynamic content to interact with databases.
This article will explain how to install and configure PHP7.2 on CentOS.
Install PHP 7.2 on CentOS
Note: By default, CentOS 7 comes with PHP version 5.4 only.
PHP 7.2 package is available in several different repositories lets enable the Remi repository to install PHP 7.2.
- Run the below commands to install EPEL and Remi repositories.
# sudo yum -y install epel-release yum-utils
# sudo yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm - Next, Enable the PHP7.2 Remi repositories
# sudo yum-config-manager --enable remi-php72
- Install PHP 7.2 and common PHP modules.
# sudo yum -y install php php-common
- Check the PHP version using the below command.
# php -v