how to install php 5.4 install on ubuntu desktop 12.04?

php, ubuntu

Solution

Add this ppa

sudo add-apt-repository ppa:ondrej/php

Then update and upgrade, upgrade will automatically install latest 5.4.x version of php

sudo apt-get update
sudo apt-get upgrade

Followed by,

`sudo apt-get install -y php5.6`

or

`sudo apt-get install -y php7.2`

depending on which version of PHP you want installed.

To install through Ubuntu software centre

php5

(source: ubuntu.com)

Ref: https://askubuntu.com/questions/109404/how-do-i-install-latest-php-in-supported-ubuntu-versions-like-5-4-x-in-ubuntu-1

Problem

I try to install php5 package with a specific version 5.4. But I have problem and can not solve it myself. When I try to install : ``` "apt-get install php5=5.4.9-4ubuntu2" ``` It returns me an error: E: Version '5.4.9-4ubuntu2' for 'php5' was not found. How can I solve this task?

Original source