Installing PHP 5.4.6
You need to issue these commands through the terminal
sudo add-apt-repository -y ppa:ondrej/php5 sudo apt-get update sudo apt-get install -y php5 libapache2-mod-php5
With this command restart the Apache 2.
sudo /etc/init.d/apache2 restart
You need to run this command to check if the installation process of PHP 5.4.6 is successful.
php5 -v
$ php5 -v
PHP 5.4.6-2~precise+1 (cli) (built: Aug 30 2012 14:38:34)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologie
Otherwise with this command create a PHP file.
echo “<?php phpinfo(); ?>” | sudo tee /var/www/test.php
Then you have to restart Apache2.
sudo /etc/init.d/apache2 restart
Hits: 53