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