Advance

Tutorial How to install and configure PHP on Ubuntu 20.04

Tutorial how to install and configure PHP on Ubuntu 20.04
1
(1)

How to install and configure PHP on Ubuntu 20.04 Linux Servers.

In this tutorial, we will look at how to install and configure PHP on Ubuntu 20.04 and Linux virtual servers. And in PHP versions 7.2, 7.3, and 7.4, install and configure.

How to Work, install and configure PHP on Ubuntu 20.04

After installing the full version of PHP, you can install multiple versions of PHP on the Ubuntu system according to your needs to change PHP versions.

Step 1) Add PHP PPA with two the command below

First, need is updating package:

sudo apt update  

Then you need to configure repository on your system:

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

If you successfully update and complete the installation, we will move on to the second step.

Step 2) Install Required PHP Version (PHP 7.2, PHP 7.3, PHP 7.4)

You can install the desired version according to the following steps:

Install PHP 7.2

To install this version need is that’s run the command below:

sudo apt install php7.2  

Install PHP 7.3

PHP 7.3 is a current active release of PHP on the Ubuntu. For the install this version run the command below:

sudo apt install php7.3  

Install PHP 7.4

PHP 7.4 is the latest stable version available for installation. To install this version on the Ubuntu VPS Server, run the command below:

sudo apt install php7.4  

Note: It is recommended that you upgrade your programs before installing PHP versions so that you do not have any problems.

Recommended Article: Tutorial Install Python 3 on RHEL 8 / CentOS 8

Step 3) Check PHP Version

After completing the installation steps, you can check the php version with the following command:

php -v  

Step 4) Switch Between PHP Versions

For the use of update-alternatives command to set the default PHP version, use the command below:

update-alternatives --config php  

Congratulations, you can successfully install and configure PHP on Ubuntu 20.04.

How useful was this post?

Click on a star to rate it!

Average rating 1 / 5. Vote count: 1

No votes so far! Be the first to rate this post.

View More Posts
Tom Veitch
Eldernode Writer
We Are Waiting for your valuable comments and you can be sure that it will be answered in the shortest possible time.

Leave a Reply

Your email address will not be published. Required fields are marked *

We are by your side every step of the way

Think about developing your online business; We will protect it compassionately

We are by your side every step of the way

+8595670151

7 days a week, 24 hours a day