I'm trying to install php5.4 but i can't find it in the packages, I added also paa or ppa repository and nothing... I specifically need 5.4 cause all the php files aren't working so well on latest versions. thank you very much.
2 Answers
PHP 5.4 security support has ended on 3. September 2015. You should upgrade your script the latest supported PHP version. At the time of writing this, the recommended version is at least PHP 5.6 that will be supported until 31. December 2018.
Running unsupported version of PHP is strongly discouraged as the obsolete version have or will have security vulnerabilities. The aforementioned PPA is kept only for historic reasons and I will not produce any new builds of PHP 5.4 for any Ubuntu version.
You can still use it to install latest PHP 5.4 on Ubuntu 12.04 LTS, but again it's strongly discouraged to do so. See my answer to similar request for PHP 4: Installing obsolete libapache-mod-php4

- 7,940
-
thank you very much. i'm using php5.5 now and it's working. – user6389884 Jun 14 '16 at 20:51
Use the following set of command to add PPA for PHP 5.4 in your Ubuntu system and install PHP 5.4
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php5-oldstable
sudo apt-get update
sudo apt-get install -y php5
To check the installed version, just type:
php -v
Source : How to Install PHP 5.4 or PHP 5.5 or PHP 5.6 on Ubuntu 16.04, 14.04 or 12.04 using PPA

- 3,699
-
4Error Package 'php5' has no installation candidate, Package php5 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source – user6389884 Jun 12 '16 at 19:16
-
@user6389884, Maybe this question will help Can't install php5 on Ubuntu 16.04 – Bilal Jun 12 '16 at 19:21
-
still nothing... they say you need to downgrade from ubuntu 16.04 to 14. – user6389884 Jun 12 '16 at 19:36