How To Install PHP 8.0 on CentOS 8 Linux?
For teams turning “How To Install PHP 8.0 on CentOS 8 Linux?” into a repeatable delivery task, payroll mistakes can document setup, troubleshooting and review time; managers should interpret those records alongside reliability and completed work, not as a stand-alone score.
Package and operating-system behaviour can change, so verify the commands and supported versions through Ubuntu before running them on a production host.
Dec 20, 2022
Hi Dev,
Now, let's see article of how to install php 8.0 on centos 8. I explained simply about 4 easy steps to install php on centos 8. We will look at example of install php 8 on centos 8 linux. I would like to share with you install and use php 8 on centos 8 / rhel 8.
Just follow the following steps to install and configure PHP 8.x on CentOS 8:
Step 1: Enable the Remi repository
Open terminal or command line and execute the following command into it to enable the remi repository in centOS 8:
sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
sudo dnf module enable php:remi-8.0 -y
Once the remi repository installation is complete, execute the following command on terminal or command line to get a list of all available PHP versions:
sudo dnf module list php
Step 2: Installing PHP 8 on CentOS
Execute the following command on the command line to install PHP 8 on CentOS:
sudo dnf install php php-opcache php-gd php-curl php-mysqlnd
FPM is installed as a dependency and used as a FastCGI server. Start the FPM service and enable it to automatically start on boot:
sudo systemctl enable --now php-fpm
Step 3: Install Apache with PHP 8 on CentOS
The following command on terminal or command line to Apache web server on our system:
sudo dnf install httpd -y
Step 4: Configuring PHP to work with Apache
Apache as web server on our system, so restart the httpd service using the following command:
sudo systemctl restart httpd
Lets create php info file on your CentOS server. The default virtulhost uses /var/www/html as document root. So create a file under this directory:
echo "<?php phpinfo(); ?>" > /var/www/html/info.php
I hope it could help you...
- How To Use Php Conditional Statement Example
- How to Check if String Contains Regex in PHP?
- PHP Array_column() Function Example
- PHP Generate List of Random Numbers Between 0 and 100 Example
- How to User Login with Facebook in PHP?
- How to Explode Every Character into Array Using PHP Example?
- PHP Form Validation Tutorial
- PHP Convert XML to JSON Example