(Last Updated On: January 26, 2019)

Welcome to our guide on how to Install PHP 7.3 on RHEL 8. PHP 7.3 was recently released with plenty of new features, bug fixes, performance improvement, deprecations as well as new functionalities. You can read more on the PHP ChangeLog page.

For installation of PHP 7.3 on other operating systems, use below guides:

How to Install PHP 7.3 on Arch Linux and Manjaro

How to Install PHP 7.3 on Debian 9 / Debian 8

How to install PHP 7.3 on Ubuntu 18.04 / Ubuntu 16.04 / Debian

How to Install PHP 7.3 on CentOS 7 / Fedora

How to install PHP 7.3 / PHP 7.3-FPM on Linux Mint 19

Install PHP 7.3 on RHEL 8

Update your RHEL 8 system.

sudo dnf -y update

Add Remi repository to RHEL 8:

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

Remi stream for PHP 7.3 and PHP 7.2 should be dded to your RHEL 8 system.

# yum module list | grep php
php                  remi-7.2      common, devel, minimal                    PHP scripting language                                             
php                  remi-7.3      common, devel, minimal                    PHP scripting language                                             
php                  7.1           devel, minimal, default [d]               PHP scripting language                                             
php                  7.2 [d]       devel, minimal, default [d]               PHP scripting language    

Enable Remi repository for PHP 7.3

dnf install dnf-plugins-core
dnf config-manager --set-enabled remi-php73
dnf config-manager --set-enabled remi

Then install PHP and the extensions you want to use.

sudo dnf -y install php php-cli

To install other extensions, use the name format php-<extension>. Example:

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

You should now have PHP 7.3 installed on RHEL 8.

$ php -v
PHP 7.3.1 (cli) (built: Jan 8 2019 13:55:51) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.1, Copyright (c) 1998-2018 Zend Technologies

The default PHP configuration file is /etc/php.ini . For Nginx web server, use PHP-FPM (FastCGI Process Manager) configuration file to set CGI settings /etc/php-fpm.d/www.conf

When PHP settings are modified, you may need to restart your Web server.

sudo systemctl restart nginx
OR
sudo systemctl restart httpd

Enjoy using PHP 7.3 on RHEL 8. For installation and usage of PHP 7.2/7.1, refer to:

How to Install PHP 7.2 ,7.1 on RHEL 8

Tags:

  • How to Install PHP 7.3, on RHEL 8
  • How to Install PHP 7.3-FPM on RHEL 8