Install PHP 7.3.10 on CentOS 8
CentOS 8 comes with PHP 7.2 by default, you can check with this command:
dnf info php
We need use a third-party repository for install PHP 7.3.x
1. Enable EPEL repository
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
2. Install REMI repository
dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
3. Install PHP 7.3.x
Check which versions of PHP are available:
dnf module list php
Output:
CentOS-8 - AppStream
Name Stream Profiles Summary
php 7.2 common [d], devel, minimal PHP scripting language
Remi's Modular repository for Enterprise Linux 8 - x86_64
Name Stream Profiles Summary
php remi-7.2 common [d], devel, minimal PHP scripting language
php remi-7.3 [e] common [d], devel, minimal PHP scripting language
php remi-7.4 common [d], devel, minimal PHP scripting language
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
Enable PHP 7.3 module to install PHP 7.3.x
dnf module enable php:remi-7.3 -y
Install PHP 7.3.x
dnf install -y php php-cli php-common
4. Check PHP Version
php -v
Output:
PHP 7.3.10 (cli) (built: Sep 24 2019 09:20:18) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.10, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.10, Copyright (c) 1999-2018, by Zend Technologies