I need to use an older version of php for my project (I know that it isn't supported). I have tried adding PPA ppa:ondrej/php , but it doesn't work - It couldn't find the package. Is there another way? Simple

sudo apt-get install php5

doesn't work either; it returns no installation candidate

  • Try to install php5.5 instead of just php5.
    – user508889
    Nov 15 '16 at 18:35
  • @bc2946088 the same: "E: Couldn't find any package by glob 'php5.5'"
    – Katarzyna
    Nov 15 '16 at 18:39
  • 1
    5.5 may not be supported on 16.04. Try 5.6 and take a look at the link ^^ for additional commands and information if needed.
    – user508889
    Nov 15 '16 at 19:33

After adding the repository http://ppa.launchpad.net/ondrej/php/ubuntu you have to update your repositories. Please try this:

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php5.5

You can use php5.6 instead..

  • 4
    This no longer works. 5.5 has been removed from the repo. Jun 10 '17 at 11:12
  • 8
    The PHP 5.5 have been removed from ppa:ondrej/php, the lowest version is php5.6. Note that there are differences between php5.5 and php5.6, so you need to test your code. There is a major difference with object serialisation.
    – Milos
    Jun 28 '17 at 8:32
  • Great (NOT)! A good reason not to use other people's repos. Better to build it yourself then you don't need to rely on other people judgements of 'suitability for purpose'!!! So now what?
    – gone
    Mar 5 '20 at 15:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.