Handy reference when you need to install a LAMP stack on Debian. Note that the L(AMP) is for Linux and this is not covered as this is already set up.
Before starting the installation, make sure your distribution is up to date.
MYSQL the database
You will be prompted to enter a root password for mysql
Apache2 the webserver
PHP Scripting Langauage
Now to test that it works
and insert the following code.
save the file in /var/www/ as test.php
then point your web browser to http://localhost/test.php and all should work.
phpMyAdmin Administration of MySQL with the use of a web browser
You will be asked which web server to use, so select apache2 and then enter passwords when prompted.
point the web browser to http://localhost/phpmyadmin/ and access phpmyadmin
One final thing to do which is usual issue with PHP configuration is to enable MySQL. Just edit the file and uncomment the following line (tip: search for extension)
;extension=mysql.so to extension=mysql.so