How to Install PHP 7.4 in Rocky Linux 8

By default, Official Rocky Linux 8 software repositories comes with PHP 7.2 . The newer PHP versions is also available within the Rocky Linux 8 - AppStream repository. We will show here how to enable and install PHP 7.4 on Rocky Linux 8.

PHP is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. As of April 2020, PHP 7 is the most used version of the language with 50.6% of sites using PHP and 39.6% of all websites on the web.

Enable PHP 7.4

Below command will show the list of all available PHP versions.

sudo dnf module list php


Enable the required version

sudo dnf module enable php:7.4


Install PHP 7.4

sudo dnf install php