How to change php7.4 to 8.2 version in linux

Posted by

You must follow certain steps, depending on your Linux distribution, to upgrade PHP from version 7.4.3 to 8.2 on a Linux machine. The instructions for CentOS/Red Hat and Ubuntu/Debian are listed below:

For Ubuntu

Step 1: Add the PHP repository for PHP 8.2

sudo add-apt-repository ppa:ondrej/php
sudo apt update

Step 2: Install PHP 8.2:

sudo apt install php8.2

Step 3: Disable the current PHP version (e.g., PHP 7.4):

sudo a2dismod php7.4

Step 4: Enable PHP 8.2:

sudo a2enmod php8.2

Step 4: Restart your web server

For Apache:

sudo systemctl restart apache2

For Nginx:

sudo systemctl restart nginx

I hope this change php version process is helpfull for you.

Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x