Cloudbooklet
  • News
  • Artificial Intelligence
  • Applications
  • Linux
No Result
View All Result
Cloudbooklet
  • News
  • Artificial Intelligence
  • Applications
  • Linux
No Result
View All Result
Cloudbooklet
No Result
View All Result
Home Google Cloud

How to Install PHP 8 on CentOS 8

by Cloudbooklet
3 years ago
in Google Cloud
Install Php 8 On Centos 8
ShareTweetSendShare
Readers like you help support Cloudbooklet. When you make a purchase using links on our site, we may earn an affiliate commission.

How to Install PHP 8 on CentOS. This guide let you learn how install the latest PHP version 8 on your CentOS system or your CentOS server on any VPS or any Cloud or any Dedicated hosting and configure it with Httpd and Nginx. The latest PHP 8 version is officially released on November 26th, […]

ADVERTISEMENT

How to Install PHP 8 on CentOS. This guide let you learn how install the latest PHP version 8 on your CentOS system or your CentOS server on any VPS or any Cloud or any Dedicated hosting and configure it with Httpd and Nginx.

The latest PHP 8 version is officially released on November 26th, 2020. It comes with a number of new features and a few incompatibilities that you should be aware of before upgrading from the previous version.

This installation is tested on Google Cloud Platform with a Compute Compute Engine VM Instance. So this set up is guaranteed to work on all Linux based servers.

ADVERTISEMENT

Prerequisites

  1. A CentOS server set up with sudo privileges.

Getting Started

Make sure your CentOS server is having the latest packages by running the following command.

You might also like

How To Setup Ssh Keys On Ubuntu

How to Setup SSH Keys on Ubuntu 20.04

4 months ago
Draggan Ai Editing Tool Install And Use Draggan Photo Editor

DragGAN AI Editing Tool Install and Use DragGAN Photo Editor

4 months ago
sudo yum update
sudo yum upgrade

This will update the package index and update the installed packages to the latest version.

Install Remi Repository

As PHP 8.0 is not available in the default repositories you need to install the Remi repository and yum-utils and enable the epel-release.

ADVERTISEMENT
sudo dnf -y install http://rpms.remirepo.net/enterprise/remi-release-8.rpm
sudo dnf -y install dnf-utils

Now you can see the available PHP version for installation using the following command.

sudo dnf module list php

You can see that PHP 8.0 will be available through the Remi repository.

ADVERTISEMENT

Now you can reset the module and enable PHP 8.0

sudo dnf module reset php
sudo dnf module install php:remi-8.0

Once this is done you can install PHP 8.0

ADVERTISEMENT

Install PHP 8 for HTTPD

Execute the following command to install PHP 8

sudo dnf install php

After the installation has completed, you can confirm the installation using the following command

ADVERTISEMENT
php -v
Output

PHP 8.0.0 (cli) (built: Nov 24 2020 17:04:03) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.0, Copyright (c), by Zend Technologies

Install PHP 8.0 FPM for Nginx

For Nginx you need to install FPM, execute the following command to install PHP 8 FPM.

sudo yum install php-fpm

After the installation has completed, enable the service using the following command.

sudo systemctl enable php-fpm.service

Start PHP-FPM service with the below command.

sudo systemctl start php-fpm.service

Install PHP 8 Extensions

Installing PHP extensions are simple with the following syntax.

sudo dnf install php-extension_name

Now, install some commonly used php-extensions with the following command.

sudo dnf install php-{common,mysql,xml,xmlrpc,curl,gd,imagick,cli,dev,imap,mbstring,opcache,soap,zip,intl,bcmath} -y

Configure PHP 8.0

Now we configure PHP for Web Applications by changing some values in php.ini file.

For PHP 8 the php.ini location will be in following directory.

sudo nano /etc/php.ini

Hit F6 for search inside the editor and update the following values for better performance.

upload_max_filesize = 32M 
post_max_size = 48M
memory_limit = 256M
max_execution_time = 600
max_input_vars = 3000
max_input_time = 1000

Once you have modified your PHP settings you need to restart your Httpd or PHP-FPM for the changes to take effect.

Configure PHP 8 FPM Pools – Nignx

PHP 8.0 FPM allows you to configure the user and group that the service will run under. You can modify these using the following commands.

sudo nano /etc/php-fpm.d/www.conf

Change the following lines by replacing the www-data with your username.

user = username 
group = username 
listen.owner = username
listen.group = username

Hit CTRL+X and Y to save the configuration and check if the configuration is correct and restart PHP.

Restart PHP 8 FPM – Nginx

Once you have updated your PHP FPM settings you need to restart it to apply the changes.

sudo systemctl restart php-fpm.service

Now you are having PHP 8.0 Installed and configured in CentOS.

Prepare yourself for a role working as an Information Technology Professional with Linux operating system

Conclusion

Now you have learned how to install PHP 8 on your CentOS server.

Thanks for your time. If you face any problem or any feedback, please leave a comment below.

Tags: CentOSPHP
Share2Tweet1SendShare
Cloudbooklet

Cloudbooklet

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Related Posts

Set Up Deep Learning With Nvidia, Cuda, Cudnn On Ubuntu

How to Set Up Deep Learning with Nvidia, CUDA, cuDNN on Ubuntu 22.04

7 months ago
How To Install Or Upgrade Php 8.2 On Ubuntu 22.04

How to Install or Upgrade PHP 8.2 on Ubuntu 22.04

9 months ago
How To Change Timezone On Ubuntu 22.04

How to Change Timezone on Ubuntu 22.04

1 year ago
How To Install Ansible On Ubuntu 22.04

How to Install Ansible on Ubuntu 22.04

1 year ago

Follow Us

Trending Articles

Google Bard Extension

Google Bard Extensions: How to Link Your Gmail, Docs, Maps, and More to an AI Chatbot

September 21, 2023

10 Best Minecraft Server Hosting Providers in 2023

Create a Professional Website with Wix AI Website Builder

Best 10 AI Comic Generator: Create Comic book in Seconds

5 Best Laptop for Minecraft in 2023: Top Picks for All Budgets

AI Annotation Jobs: Everything You Need to Know

Popular Articles

Stable Diffusion For Free

3 Ways to Use Stable Diffusion AI Art Generator for Free

August 24, 2023

7 Best AI Album Cover Generators to Create Stunning Artwork

Free AI Script Generators Online to Create High Quality Scripts

5 Best TikTok Private Account Viewer in 2023

10 Best AI Video Generator Free of 2023

8 Best Tools for Website Malware Scanning Online Free

Subscribe Now

loader

Subscribe to our mailing list to receives daily updates!

Email Address*

Name

Cloudbooklet Logo

Welcome to our technology blog, where we explore the latest advancements in the field of artificial intelligence (AI) and how they are revolutionizing cloud computing. In this blog, we dive into the powerful capabilities of cloud platforms like Google Cloud Platform (GCP), Amazon Web Services (AWS), and Microsoft Azure, and how they are accelerating the adoption and deployment of AI solutions across various industries. Join us on this exciting journey as we explore the endless possibilities of AI and cloud computing.

  • About
  • Contact
  • Disclaimer
  • Privacy Policy

Cloudbooklet © 2023 All rights reserved.

No Result
View All Result
  • News
  • Artificial Intelligence
  • Applications
  • Linux

Cloudbooklet © 2023 All rights reserved.