Last Updated on 2 days by Sachin G

This tutorial explains how to install PHP 7 on CentOS or RHEL using the Remi repository. It highlights the benefits of PHP 7, including better speed and features like scalar type declarations and 64-bit support, then walks through adding the Remi repo, searching packages, installing PHP 7.4, and verifying the version.

Features of PHP 7 

Here are some features of PHP 7 , which makes php 7 is different from older version .

  • PHP 7 is twice faster than PHP 5.6 Version.
  • Return and Scaler Type Declarations
  • Anonymous function support
  • 64-bit support
  • Fatal errors are now change as Exceptions
  • Removal of old and unsupported SAPIs and extensions
  • The null coalesce operator (??)

STEP 1: Configure Remi Repository

For Configure REMI Repository on your Server operating system , you can follow in below link for installation of remi repo.

Install Remi Repository on CentOs or Red Hat / Fedora

After installation of this repositories on your server then we will go through on our next steps to install php 7 Version and its module installation , if needed.

STEP 2 : Search PHP Packages

PHP 7 available in remi package list , you can  check through below command .

# yum list php7*

OR

# yum search php7*

STEP 3 : Install latest php package

Find the latest php package and install it on the system. you can filter other php related software and install it according to your need.

# yum install php74 -y
PHP 7 Version On CentOS 8

STEP 4 : Verify PHP Version

[root@server1]# php74 -v
PHP 7.4.4 (cli) (built: Mar 17 2020 10:40:21) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies