ItSolutionStuff.com

How to Upgrade PHP Version from 7.4 to 8 in Ubuntu?

By Hardik Savani • May 14, 2024
PHP

Here, i will show you how to works update php 7.4 to 8 ubuntu. you will learn upgrade php 7.4 to 8 ubuntu. it's simple example of how to upgrade php 7.4 to 8 ubuntu. this example will help you ubuntu update php 7.4 to 8. Follow bellow tutorial step of ubuntu 20 upgrade php 7.4 to 8.

just follow bellow command to update php 7.4 to php 8 in ubuntu os.

Add PPA for PHP 8.0

sudo apt install software-properties-common

sudo add-apt-repository ppa:ondrej/php

sudo apt-get update

Install PHP 8

sudo apt install php8.0

Install PHP 8 Packages

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

PHP 8 Enable

sudo a2dismod php7.4

sudo a2enmod php8.0

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: PHP
Hardik Savani

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

📺 Subscribe on YouTube

We Are Recommending You

PHP Explode Every Character into Array Example

Read Now →

How to Export Mysql Database using Command Line in Ubuntu?

Read Now →

How to Import Database in Mysql using Command Line in Ubuntu?

Read Now →

Angular 12 Httpclient Service Request Example

Read Now →

How to Install Yarn npm in Ubuntu?

Read Now →

How to Upgrade PHP Version from 7.3 to 7.4 in Ubuntu?

Read Now →

How to Upgrade PHP Version from 7.2 to 7.3 in Ubuntu?

Read Now →

How to Enable Apache mod_rewrite Module in Ubuntu?

Read Now →

Laravel 8 REST API with Passport Authentication Tutorial

Read Now →

How to Downgrade php 7.4 to 7.3 Ubuntu?

Read Now →

How to Enable Rewrite Mode for Apache in Ubuntu?

Read Now →