Linux – PHP 5.3.10 on Debian Jessie

debianlinuxphp5

By default in Debian Jessie, I get PHP 5.6 installed by using apt-get install php5 .
The problem is that the project that I'm working on has severely deprecated functions to the point that the project isn't working properly, and I have failed to suppress any of those deprecation warnings. They just won't go away.

After consulting with one of my colleagues, I've decided to install an older version of PHP, namely 5.3.10. This is the version he's using and the project is running fine.

I've been searching around the debian packages and I've managed to install PHP 5.3.29 (for Wheezy), but again the project is not working at all.

How would I get around installing a 5.3.10 on Jessie? I have found the required source here.
http://php.net/releases/
But I honestly do not know what features I need from PHP and I also do not understand what apache folder I need to use when building. Online guides showed something similar to apache/bin, but I am not aware of such a folder on my PC (yes, apache is installed and working properly).

Is there a different way, or am I stuck to building PHP from scratch? There is virtually no 5.3.10 package in the jessie repos. Only 5.6.

Best Answer

I wouldn't recommend going backwards on PHP versions but if you have no other choice then simply add a Debian snapshot to your repo and then install passing the version number.

You can view a full explanation here: http://mstd.eu/index.php/2016/07/04/install-old-versions-of-software-on-debian-like-php-5-3/

You can find all the information you need here: http://snapshot.debian.org

But if you're lazy (like me) just copy and paste the following:

Add the source lists:

deb http://snapshot.debian.org/archive/debian/20120221T041601Z/ unstable main
deb-src http://snapshot.debian.org/archive/debian/20120221T041601Z/ unstable main

Now update apt but ignore expiry dates:

apt-get -o Acquire::Check-Valid-Until=false update

Now you can pass in the version number you need 5.3.10-2 in this case

apt-get install php5=5.3.10-2

A bit more info if you was wondering on how I got to this, if you find the package you need on a snapshot in this case here: http://snapshot.debian.org/package/php5/5.3.10-2/ it gives you the date it was first added 2012-02-21 04:16:01 so then you simply add this into the snapshot source list like so:

http://snapshot.debian.org/archive/debian/yyyymmddThhmmssZ

In the case above this translates to:

deb http://snapshot.debian.org/archive/debian/20120221T041601Z/
Related Question