Run the below command in terminal:
wget --no-cache -O - https://gist.github.com/EmpireWorld/737fbb9f403d4dd66dee1364d866ba7e/raw/install-lamp.sh | bash
First off, run the below command to update package index:
sudo apt update
Then run these commands in terminal 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
Adjust Firewall
sudo ufw allow in "Apache Full"
Adjust permissions
sudo chmod -R 0755 /var/www/html/
Allow running Apache on boot up
sudo systemctl enable apache2
Start Apache server
sudo systemctl start apache2
Test Apache
xdg-open "http://localhost"
Create sample PHP script file
sudo echo "<?php phpinfo(); ?>" > /var/www/html/info.php
Run sample PHP script file
xdg-open "http://localhost/info.php"
Run the below command in terminal to install phpMyAdmin and it's prerequisites:
sudo apt install phpmyadmin php-mbstring php-gettext
And then enable required extensions:
sudo phpenmod mcrypt
sudo phpenmod mbstring
Then restart Apache server:
sudo systemctl restart apache2
Now navigate to the phpMyAdmin:
xdg-open "http://localhost"
All done. now you have Apache2, MySQL, PHP installed.
Made with ❤️ by Bayat
works like a charm ;) thank you