This is a very simple and short linux shell script to install php in your ubuntu machine. This worked for me on Ubuntu 20TLS
$ chmod +x installPHP.sh
$ ./installPHP.sh
installPHP.sh
#!/bin/bash
# Shell script to install PHP. Provided by https://www.webune.com
clear
# update your package manager
sudo apt update && upgrade
sudo apt install php
# Create a PHP project in user's home directory
cd ~
mkdir php_projects
cd php_projects
echo "<?php phpinfo(); ?>" > index.php
# Open browser
xdg-open http://localhost:4000
# Run PHP development server
php -S localhost:4000