Install php 8.1 centos 8
In today’s guide, we are going to learn how to install PHP 8.1 on CentOS 8/RHEL 8 Show PHP is a general-purpose scripting language suitable for web development. Most websites out there are programmed using PHP language because it is:
Prerequisites for Installing PHP 8.1
PHP 8.1 is a major update release version. It contains many new features and optimizations e.g
Related Articles
Table of contents
1. Run system updatesThe first thing you need to do is to run system updates to make all repositories up to date. To do so run the following command on your terminal.
When updates are complete, proceed to check the list of available modules lists belonging to PHP. Use the following command to do so;
The output will look like the one below;
From the above output, you can see that we don’t have PHP 8.1, so what we need to do is to enable the Remi package repository. This is the maintainer of this RPM package. But first, enable EPEL repository for CentOS 8/RHEL 8. 2. Enable EPEl for CentOS 8/RHEL 8Extra Packages for Enterprise Linux (EPEL) is a Fedora Special Interest Group that creates, maintains, and manages a high-quality set of additional packages for Enterprise Linux, including, but not limited to, Red Hat Enterprise Linux (RHEL), CentOS, and Scientific Linux (SL), Oracle Linux (OL). To enable EPEL on CentOS 8/RHEL 8, run the following command on your terminal.
Output will look like this;
When this is complete, then we can now add remi report repository. 3. Enable Remi report repositoryLet’s enable remi repository with the following command;
You will get output as shown below;
Now you can list PHP modules to see if PHP 8.1 has been added.
This time you will get the following output.
We have successfully added PHP 8.1 into our repository, let’s enable it before running the installation. Enable remi PHP 8.1 with the following command;
You will get the following output.
Now that we have enabled remi repository, we need to install web server to server the PHP. I am going to use Nginx webserver. Check this on how to install Nginx.
Check PHP version you have installed.
ConclusionWe have successfully installed PHP 8.1 on CentOS 8/RHEL 8. I hope you are comfortable with how to add remi now. |