How to Install PHP 7.3 in CentOS 7
To keep up with the latest features and security updates, We need the latest version of PHP on your system.
Here are the steps to install PHP 7 on CentOS 7
1. To install PHP 7, you have to install and enable EPEL and Remi repository on your CentOS 7 system with the commands below.
# 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, you need to install yum-utils, a collection of useful programs for managing yum repositories and packages. It has tools that basically extend yum’s default features.
# yum install yum-utils
3. One of the programs provided by yum-utils is yum-config-manager, which you can use to enable Remi repository as the default repository for installing different PHP versions as shown.
If you want to install PHP 7.0, PHP 7.1, PHP 7.2 or PHP 7.3 on CentOS 7, just enable it as shown. # yum-config-manager --enable remi-php70 [Install PHP 7.0]
# yum-config-manager --enable remi-php71 [Install PHP 7.1] # yum-config-manager --enable remi-php72 [Install PHP 7.2] # yum-config-manager --enable remi-php73 [Install PHP 7.3]
4. Now install PHP 7 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
Afterward, you can check the installed version of PHP on your system.
# php -v