Upgrade PHP 7.4 to PHP 8.0

About the author : Gyanendra Giri

WordPress Developer with 8+ years of experience in theme design and plugin development.

Ubuntu 20.3 by default ships with PHP 7.4. Follow these steps to upgrade the PHP version to PHP 8.0.

Add PPA for PHP 8.0

sudo apt install python-software-properties
sudo add-apt-repository ppa:ondrej/php

Update the system

 sudo apt-get update

For Apache

sudo apt install php8.0

Install required PHP 8.0 modules.

sudo apt install php8.0-cli php8.0-xml php8.0-mysql

Verify the default PHP version

php -v

Set PHP 8.0 as the default version

sudo update-alternatives --set php /usr/bin/php8.0

Enable PHP 8.0

sudo a2enmod php8.0

Disable PHP 7.4

sudo a2dismod php7.4

Restart Apache

sudo service apache2 restart

About the author : Gyanendra Giri

WordPress Developer with 8+ years of experience in theme design and plugin development.

Leave A Comment