How to install php 5.2 in Ubuntu 18.04

15,315

this post: How to install PHP 5.2.x on ubuntu 14.04?

tells you how to install it on 14.04 (which is called "build from source" which you can look it up by). Should alsso work on 18.04 I think (but didn't try)

Easier method is running a virtual machine with older Ubuntu version installed (I'm suggesting 12.04 where 5.2 was still around).

another aproach is to run everything insider docker container, like this one: https://hub.docker.com/r/kuborgh/php-5.2/

but I'd follow other suggestions: your PHP is insecure and running anything production-like is going to eventually lead to a security breach and financial losses, even your boss should understand that and simply accept the upgrade process to PHP 5.6 at least.

Share:
15,315

Related videos on Youtube

Miksser
Author by

Miksser

Updated on September 18, 2022

Comments

  • Miksser
    Miksser over 1 year

    All the answers that I found are already outdated. I can not fix all dependencies by myself. Maybe someone has a guide on what to do to run php5.2?

    • Thomas Ward
      Thomas Ward over 5 years
      5.2 is so old and insecure you shouldn't need to use it. Why do you need 5.2?
  • Thomas Ward
    Thomas Ward over 5 years
    Unless their code is so obsolete it onyl works on PHP 5.2, in which case they've got a bigger issue.
  • Miksser
    Miksser over 5 years
    We still have support 5.2 = (And all programmers use 5.6+, which sometimes leads to compatibility problems. Therefore, we need to run the tests on 5.2.
  • LeonidMew
    LeonidMew over 5 years
  • Miksser
    Miksser over 5 years
    I tried to use the guide under ubunt 14.04. There is incompatibility of libxml2 libraries. Attempts to straighten it out without breaking php 7.2 have failed. Apparently, the truth remains only the docker.
  • Jan Myszkier
    Jan Myszkier over 5 years
    php before 5.6 was installed only under php so this will break your current default php package (7.2?). If you need to solve it quickly, I'd go with dedicated server machine running ubuntu 12.04 somewhere over the network. Otherwise - yes - docker.
  • Calamity Jane
    Calamity Jane about 3 years
    No, saying he should install 5.6 is neither an answer nor helpful. Yes having to work with 5.2 sucks, but in some cases cannot be avoided. In my current company we have tons of legacy code running on 5.2 or 5.3. The applications will be either switched off or rewritten in php7.4 or php8 within the next 1-3 years, so our admin has exactly the problem mentioned here. Suggesting to use 5.6 doesn't help at this point at all.