PHP stands for Hypertext Preprocessor which was initially released in 1995 to enhance web development. PHP 8.0 was released on November 26, 2020, with major updates like new features and optimization including null safe operator, Just in Time Compiler (JIT), error handling, match expression, etc.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related PHP extension queries on Linux System.
In this context, we shall look into how to install PHP 8.0 on Rocky Linux.
Step by Step Process to Install PHP 8 on Rocky Linux
As PHP 8.0 version is not available in Rocky Linux AppStream repositories, we will install it from a third-party repository called Remi. To begin, we need to install the Extra Packages for Enterprise Linux (EPEL) repository that provides additional software packages for Enterprise Linux.
To install EPEL execute the command:
$ sudo dnf install epel-release
Now, execute the following commands to enable the Remi repository:
$ sudo dnf install dnf-utils
$ sudo dnf install http://rpms.remirepo.net/enterprise/remi-release-8.rpm
Once the Remi repository is added PHP 8 module can be enabled in the Remi repository. Then, we need to first reset the default PHP module, so execute:
$ sudo dnf module reset php
Next, Reset Remi PHP Default Module.
Now, enable PHP 8 module using the following command:
$ sudo dnf module enable php:remi-8.0
Remi’s PHP 8 module enabled.
Similarly, you can view all the php modules using the following command:
$ sudo dnf module list php
Now, once the module is enabled for remi php 8 you can install the PHP using the following command:
$ sudo dnf install php
Now, you can verify the installation you can check the version by running the command:
$ php -v
[Need help in Configuring PHP on any Linux System ? We can help you. ]