Install PHP in Ubuntu 20.04 by running the commands below.

sudo apt update
sudo apt upgrade -y
sudo apt install php libapache2-mod-php -y

Add a simple php file to test if PHP was successfully installed. Create a file name info.php.

sudo -u www-data vim info.php

Paste the content below into the file.

<?php
phpinfo();
?>

If PHP was successfully installed, you should see a page similar to this below with your web browser.

< Back to all the stories I had written

A software engineer, a rock climbing, diving & inline skating enthusiast, a husband, a father.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store