This article covers the PHP installation on Ubuntu 20.04 system. Basically, popular Content Management platforms such as WordPress, Drupal, and Magento are based on PHP.To Install PHP on Ubuntu 20.04:1. Update your server.$ apt-get update && apt-get upgrade2. Install PHP on Ubuntu 20.04, just run the following command.$ apt-get install php3. To verify if PHP is installed, run the following command.php -vTo Install PHP 7.4 modules (extensions):Run the command below.apt-get install php-pear php-fpm php-dev php-zip php-curl php-xmlrpc php-gd php-mysql php-mbstring php-xml libapache2-mod-phpTo check all the PHP modules available in Ubuntu, run:$ apt-cache search --names-only ^phpHow to install PHP 8.0 on Ubuntu 20.04 or 18.04 ?1. First, update your Ubuntu server:$ apt-get update && apt-get upgrade2. Add the PHP repository (by Ondřej Surý):$ apt-get install software-properties-common$ add-apt-repository ppa:ondrej/php3. And finally, update your package list:$ apt-get update4. Install PHP 8.0 with the following command:$ apt-get install php8.05. To check if PHP 8.0 is installed on your server, run the following command:$ php -v6. Install PHP 8.0 modules (extensions)You may need additional packages and modules depending on your applications. The most commonly used modules can be installed with the following command:$ apt-get install libapache2-mod-php8.0 php8.0-fpm libapache2-mod-fcgid php8.0-curl php8.0-dev php8.0-gd php8.0-mbstring php8.0-zip php8.0-mysql php8.0-xmlHow to change the PHP version you're using ?If you have multiple PHP versions installed on your Ubuntu server, you can change what version is the default one.1. To set PHP 7.4 as the default, run:$ update-alternatives --set php /usr/bin/php7.42. To set PHP 8.0 as the default, run:$ update-alternatives --set php /usr/bin/php8.03. You can verify what version of PHP you’re using with the following command:$ php -v