Wondering how to Install PHP 8 on AlmaLinux 8? We will help you.
PHP is a popular scripting language that powers the dynamic content of millions of websites and apps, therefore, if you are planning to install web CMS like WordPress, then you have to setup PHP on your AlmaLinux server.
As a part of our Server Management Services, our Support Engineers assist with Software installations regularly.
Today, let us see steps to Install it.
How to Install PHP 8 on AlmaLinux 8?
PHP 8.0 is a major update and release of the PHP programming language since version 7.4. PHP is a widely used programming language in development of websites and Web applications. Some of the most used website content management systems such as WordPress, Drupal and Joomla are written in PHP.
The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘
sudo‘ to the commands to get root privileges. I will show you through the step-by-step installation of PHP 8 on an AlmaLinux 8.
Let us see how to install it. PHP 8.0 packages are not available in OS AppStream repositories. We have to add Remi RPM repositories to our AlmaLinux OS which contains the packages that we need to install.
Add Remi YUM repository
Firstly, install and enable EPEL repository
$ sudo yum -y install epel-release
Also enable powertools repository:
$ sudo yum -y install yum-utils $ sudo yum-config-manager –enable powertools
Then, add Remi repository to AlmaLinux 8
$$ sudo yum -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
Next, install PHP 8.0 on AlmaLinux OS 8
Reset PHP default module on AlmaLinux 8:
$ sudo dnf module reset php
Enable Remi repository for PHP 8.0
$ sudo yum module install php:remi-8.0
Confirm package dependencies and proceed with the installation.
Then import required repository key when asked.
To install additional packages, use the command below:
$ sudo yum install php-xxx
Below example install PHP and commonly used PHP extensions:
$ sudo yum install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json
Then, proceed with the installation and confirm it is successful.
To check the installed PHP version:
$ php –version
To check all available PHP extensions:
$ php –modules
[Need any further assistance in fixing software installation errors? – We’re available 24*7]
In short, we saw the steps that our Support Engineers follow to install PHP version.