Welcome to our guide on how to Install PHP 7.3 on RHEL 8 / CentOS 8 Linux. 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:
Install PHP 7.3 on RHEL 8 / CentOS 8 Linux
Update your RHEL 8 system.
sudo dnf -y update
Add Remi and EPEL repository to RHEL 8:
sudo dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
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.
$ sudo dnf module list | grep php
hp 7.2 [d] common [d], devel, minimal PHP scripting language
php 7.3 common [d], devel, minimal PHP scripting language
php 7.4 common [d], devel, minimal PHP scripting language
php remi-7.2 common [d], devel, minimal PHP scripting language
php remi-7.3 common [d], devel, minimal PHP scripting language
php remi-7.4 [e] common [d] [i], devel, minimal PHP scripting language
php remi-8.0 common [d], devel, minimal PHP scripting language
php remi-8.1 common [d], devel, minimal PHP scripting language
Disable default PHP module.
sudo dnf -y install dnf-plugins-core
sudo dnf module -y reset php
Then install PHP 7.3 on CentOS 8 / RHEL 8 and the extensions that comes bundled with it.
sudo dnf module install php:remi-7.3
Accept installation when promted:
...
Transaction Summary
================================================================================================================================================================================================
Install 1 Package
Downgrade 14 Packages
Total download size: 9.2 M
Is this ok [y/N]: y
You should now have PHP 7.3 installed on RHEL 8 / CentOS 8. Confirm PHP version.
$ php -v
PHP 7.3.33 (cli) (built: Aug 1 2023 13:19:05) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.33, Copyright (c) 1998-2018 Zend Technologies
To install other extensions, use the name format php-<extension>. The example below will install standard PHP extensions.
sudo dnf install php-fpm php-mysqlnd php-zip php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json
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
Start php-fpm service:
sudo systemctl enable --now php-fpm
When PHP settings are modified, you may need to restart your Web server.
# Nginx
sudo systemctl restart nginx
# Apache web server
sudo systemctl restart httpd
Test PHP 7.3 on CentOS 8 / RHEL 8
To test our installation, install httpd.
sudo dnf module install -y httpd
Active httpd and php-fpm services:
sudo systemctl enable --now php-fpm httpd
Add phph test page:
echo '<?php phpinfo();' | sudo tee /var/www/html/info.php
Open http Port on your firewall
sudo firewall-cmd --add-service={http,https} --permanent
sudo firewall-cmd --reload
Browse to your server IP on http://localhost/info.php to see php in action.

Enjoy using PHP 7.3 on CentOS 8 / RHEL 8.
Recommended Web Development books to read:
- Best Books to learn Web Development – PHP, HTML, CSS, JavaScript and jQuery
- Best Books To Master Web Design
- Best Books To Learn CSS & CSS3
- Best Books To Learn HTML & HTML5
- Best Apache and Nginx reference Books
Tags:
- How to Install PHP 7.3 on RHEL 8 / CentOS 8
- How to Install PHP 7.3-FPM on RHEL 8 / CentOS 8
- How To Install PHP on CentOS / RHEL 8
- PHP 7.3 installation on CentOS 8 / RHEL 8