Back to Linux VPS

INSTALL PHP 8.0 ON VPS UBUNTU 20.04

INSTALL PHP 8.0 ON VPS UBUNTU 20.04
27 Oct, 2024 Linux VPS

PHP is a popular scripting language for web development, PHP scripts can run on Linux, macOS, Windows and many other Unix systems, this article will guide you to install PHP 8.0 on VPS Ubuntu 20.04

What is PHP?

PHP (Hypertext Preprocessor) is open source software (OSS) used for server-side communication such as collecting form data, managing files on the server, modifying databases…, while JavaScript can be used for both frontend and backend and Python – only for the client side (backend)

WordPress is built on the use of PHP, so this is a commonly used language, with low cost and integrated with databases such as MySQL, Oracle, Sybase… creating all kinds of platforms such as e-commerce, blogs, social media.

What is PHP 8.0?

PHP 8.0 is a major update of the PHP language, the official version of PHP 8 was released on November 26, 2020. This is a new version with many features and performance improvements. Some of the exciting new features that come with PHP 8 include JIT compilation, named arguments, type merge, attributes, and many more.

How to install PHP 8.0 on VPS Ubuntu 20.04

Step 1: Log in to VPS with Ubuntu 20.04 operating system

If you don’t have VPS Ubuntu, you can buy it here, then log in.

Step 2: Update Ubuntu system

Update all system packages to the latest version by running the commands below:

sudo apt update

sudo apt -y upgrade

install PHP 8.0 on VPS Ubuntu 20.04

Then reboot your system by running the following command:

sudo systemctl reboot

Step 3: Add the Ondrej Sury PPA repository

Ubuntu 22.04 comes with the packages and many other extensions needed for PHP 8 integration. For Ubuntu 20.04/18.04, the latest PHP packages are available in the Ondrej Sury PPA repository. Run the following commands to add this repository to your Ubuntu system.

sudo apt update

sudo apt install lsb-release ca-certificates apt-transport-https software-properties-common -y

sudo add-apt-repository ppa:ondrej/php

install PHP 8.0 on VPS Ubuntu

Press Enter when prompted to confirm.

From the update results, you will see the repositories have been added.

Step 4: Install PHP 8.0 on VPS Ubuntu 20.04

Update the APT index to ensure it is qualified for installing packages.

sudo apt update

install PHP 8.0 on VPS Ubuntu 20.04

Then, install PHP 8.0 on the Linux server Ubuntu 20.04

sudo apt install php8.0

Press y => Enter to start the installation.

Check the PHP version that has just been successfully installed on the server with the following command:

php -v

install PHP 8.0

So you have installed PHP 8.0 on VPS Ubuntu 20.04

The above is the article How to install PHP 8.0 on VPS Ubuntu 20.04, wish you a successful operation, if you have any questions about VPS Windows/Linux service, please contact us for advice and register for a free VPS account

Share on