It doesn’t get any easier than this.
sudo apt-get install lamp-server^
It will install all these packages for you…
apache2 apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common
libapache2-mod-php5 libapr1 libaprutil1 libaprutil1-dbd-sqlite3
libaprutil1-ldap libdbd-mysql-perl libdbi-perl libhtml-template-perl
libmysqlclient16 libnet-daemon-perl libplrpc-perl mysql-client-5.1
mysql-client-core-5.1 mysql-common mysql-server mysql-server-5.1
mysql-server-core-5.1 php5-cli php5-common php5-mysql
I noticed that PHP doesn’t work after the install. So all you have to do is restart apache.
$ sudo /etc/init.d/apache2 restart