Step 1.Open up the Terminal (Applications > Accessories > Terminal).

Step 2. Copy/Paste the following line into Terminal and press enter:
Code:
sudo apt-get install php5 libapache2-mod-php5
Test PHP

Step 1. In the terminal copy/paste the following line:
Code:
sudo gedit /var/www/testphp.php
Step 2. Copy/Paste this line into the phptest file:
Code:
<?php phpinfo(); ?>
Step 4. Now open you're web browser and type the following into the web address:

Code:
http://localhost/testphp.php
Good Luck