How to install LAMP on Raspberry Pi

This is how I install LAMP server on my Pi's

After a fresh Rasbian installation I do the following:

sudo apt-get update && sudo apt-get install -y apache2 php7.0 libapache2-mod-php7.0 mariadb-server phpmyadmin

Logon credentials for myphpadmin: Username: myphpadmin Password: password entered during installation

If you do not get any privileges, you need to stop the databaseserver, try this:

sudo systemctl stop mariadb

Then you'll need to start it again, but this time, without any privileges:

sudo mysql_safe --skip.grant-tables --skip-networking &

The ampersamp is for the serverto run in the background.