How to Upgrade PHP Version from 8.2 to 8.3 in Ubuntu?

By Hardik Savani November 28, 2023 Category : PHP Ubuntu

Greetings Everyone,

In this brief tutorial, we'll outline a swift and uncomplicated method to upgrade PHP from version 8.2 to 8.3 on Ubuntu. I'll guide you through the process of upgrading PHP 8.2 to 8.3 on Ubuntu, providing a straightforward example and solution for any queries you may have about the update. I've simplified the explanation of updating PHP from 8.2 to 8.3 on Ubuntu.

just follow the bellow command to update php 8.2 to php 8.3 in ubuntu os.

Add PPA for PHP 8.3

sudo apt install software-properties-common

sudo add-apt-repository ppa:ondrej/php

sudo apt-get update

Install PHP 8.3

sudo apt install php8.3

Install PHP 8.3 Packages

sudo apt install php8.3-common php8.3-mysql php8.3-xml php8.3-xmlrpc php8.3-curl php8.3-gd php8.3-imagick php8.3-cli php8.3-dev php8.3-imap php8.3-mbstring php8.3-opcache php8.3-soap php8.3-zip php8.3-intl -y

PHP 8 Enable

sudo a2dismod php8.2

sudo a2enmod php8.3

sudo service apache2 restart

now you can check php version:

php -v

If it's still show old php version then you can run bellow command and choose new php version from there list. so run bellow command:

sudo update-alternatives --config php

Then it will works

i hope it can help you....

Tags :