Docs

How To Install PHP 7.3 on CentOS 7

Originally created by Rasmus Lerdorf in 1994, PHP is one of the most popular server-side scripting languages. The latest version PHP 7.3 was released on Dec 6th, 2018, PHP 7.3 with new features, bug fixes, and performance improvement. In this tutorial, we are going to learn how to install PHP 7.3 on CentOS 7.

Step 1 - Adding PHP 7.3 Remi Repo

PHP 7.3 is available for CentOS 7 from the Remi repository.

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

Step 2 - Disabling PHP 5.4 Repo

PHP 5.4 repo is enabled by default in CentOS7. We are going to disable it then enable Remi repo:

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

Step 3 - Installing PHP 7.3

Install PHP 7.3 and necessary extension modules using the command:

$ sudo yum -y install php php-cli php-devel 

Step 4 - Verify Installed PHP

$ php -v

Step 5 - Installing Additional PHP 7.3 Extensions

We can extend the functionalities of PHP 7.3 simply by installing additional extensions. Following syntax format allows additional extension installation:

$ sudo yum install php-<extension_name>

To install a few of the commonly needed extensions, we can use the command as follows:

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