Check PHP Version

To see what the PHP version you have installed (and what is available) then use:

sudo apt-cache policy php5

You can install the latest PHP with the following command:

sudo apt-get -y install php5 libapache2-mod-php5

To make Apache recognize the updated version you will need to restart Apache:

sudo service apache2 restart