Originally Posted by Lagbehind
The second package provides support to push files with .php extensions through the PHP parser. The third package includes the driver that lets PHP talk to MySQL servers.
sudo apt-get install php5 libapache2-mod-php5 php5-mysql
The installation is simple, but you'll need to learn how to write PHP code.
After you have installed PHP, check out the installation by first creating the file /var/www/info.php like this:
Then visit http://localhost/info.php with a browser. You should see a complete listing of PHP and its installed modules and services.
sudo echo '<?php phpinfo()?>' > /var/www/info.php