Run the below command in terminal:
wget --no-cache -O - https://gist.githubusercontent.com/EmpireWorld/737fbb9f403d4dd66dee1364d866ba7e/raw/be6eecf35b9e24c0d2fb28912bdf2c9c053799d2/install-lamp.sh | bash
or run these commands separately to install each component:
Apache
sudo apt install apache2
MySQL
sudo apt install mysql-server
PHP
sudo apt install php php-mysql libapache2-mod-php php-cli
And then adjust the firewall:
sudo ufw allow in "Apache Full"
Now try the php processing:
sudo echo "<?php phpinfo(); ?>" > /var/www/html/info.php
sudo xdg-open http://localhost/info.php
All done. now you have Apache2, MySQL, PHP installed.
Made with ❤️ by Bayat