Enabling Remi repository
PHP 7.x packages are available in several different repositories. We’ll use the Remi repository which provides newer versions of various software packages including PHP.
The Remi repository depends on the EPEL repository. Run the following commands to enable both EPEL and Remi repositories:
sudo yum install epel-release yum-utils
sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
Yum may prompt you to import the repository GPG key. Type y and hit Enter.
In the following sections, we will be covering how to install PHP 7.x by enabling the appropriate Remi repository. If you already have PHP 5.4 installed on your system yum will update the PHP packages.
Installing PHP 7.3 on CentOS 7
PHP 7.3 is the latest stable release of PHP. Most modern PHP frameworks and applications including WordPress, Drupal, Joomla, and Laravel are fully supporting PHP 7.3.
Perform the steps below to install PHP 7.3 on CentOS 7.
Start by enabling the PHP 7.3 Remi repository:
sudo yum-config-manager --enable remi-php73
Install PHP 7.3 and some of the most common PHP modules:
sudo yum install php php-common php-opcache php-mcrypt php-cli php-gd php-curl php-mysqlnd
Verify the PHP installation, by typing the following command which will print the PHP version:
Read more