How to install an older version of php (5.2.17) in Linux?

10,664

Solution 1

apt-cache policy php5 will show you the available versions on Debian systems. Then you can install with apt-get install -y php5=whatever_version.

On Fedora deriviatives you can use yum --showduplicates list php does the same and you can install a specific version using yum install -y php-whatever_version

If the version you need is not available after running the first command then you need to find and add the repositories that contain the version you are looking for and try again.

After adding a software repository, make sure you do:

apt-get update (Debian) or yum check-update (Fedora_ to update your local package lists or your new software may not show up in the package lists still.

Thanks.

Solution 2

Create a virtual machine with virtualbox or VmWare Workstation (paid) and download an older version of CentOS 5 then download PHP 5.2.17 and install it normally .

Share:
10,664

Related videos on Youtube

user104787
Author by

user104787

Updated on September 18, 2022

Comments

  • user104787
    user104787 over 1 year

    I want to study some security vulnerabilities in php 5.2.17, but I can't install it from source, because then I need also all the older versions of all the other application which have something to do with php. How I can install an older version of php in the easiest way? For example in a virtual machine which is compatible with that?

    • Admin
      Admin almost 8 years
      Install an older OS that still has that version available for it or build it yourself. I'm not sure what you mean about needing to install all the older versions when building from source because that's precisely what you're going to have to do if you try to force a package install of an old version.
  • spyderdyne
    spyderdyne almost 8 years
    If you are running Ubuntu and want to use a container there is literally no reason to set up Docker since LXD is native now unless you just want to play with Docker.