I use Ubuntu14.04 and I had PHP 5.5.9 installed.
I removed the PHP 5.5.9.
Then I downloaded an installed PHP 5.4.42
and I tried this:
echo "deb http://packages.dotdeb.org squeeze-php54 all" | sudo tee -a /etc/apt/sources.list
apt-get install php5=5.4.41-1~dotdeb+6.1
The result is:
php -v
5.4.42
echo phpversion();
5.5.9
Why does Ubuntu still use PHP 5.5.9?
I recently got these problem in my Ubuntu 14.04
I searched many ways. but finally i have to installed Ubuntu 12.04
because Ubuntu 14.04 support only PHP 5.5 and above version.
so dont waste time. just Installed Ubuntu 12.04
i am not sure but here is one method that you can try to make ubuntu use php 5.4 forcefully. you will need to alter the .htaccess file in order to run all PHP scripts using PHP 5.4:
AddHandler x-mapp-php6 .php
for more infor visit : https://help.1and1.com/hosting-c37630/scripts-and-programming-languages-c85099/php-c37728/manually-set-the-version-of-php-using-an-htaccess-file-a614325.html