How to Install PHP 7.3 on CentOS 7

1) Add PHP 7.3 Remi repository. PHP 7.3 is available for CentOS 7 and Fedora distributions from the Remi repository. Add it to your system by running

 

sudo yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm  

sudo yum -y install epel-release yum-utils

 

2) Disable repo for PHP 5.4. By default, the enabled repository is for PHP 5.4. Disable this repo and enable on for PHP 7.3

 

sudo yum-config-manager --disable remi-php54
sudo yum-config-manager --enable remi-php73

 

3) How to Install PHP 7.3 on CentOS 7

 

# sudo yum -y install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json

 

Check version installed

 

# php -v

 

4) Installing other PHP 7.3 Extensions 
As an example, to install a mysql module for PHP applications that use MySQL databases, you’ll run:

 

# sudo yum install php-mysql

 

This will only work if the default repository for PHP packages is 7.3

 

# sudo yum install php-mysqlnd

## rpm -qi php-mysqlnd