0

I need to conduct some testing on older version of PHP, and I want to use my laptop running Debian Jessie.

At the moment, I've got PHP5.6 installed on it, which I tried to delete with apt-get remove php5 && apt-get autoremove, but for some reason I am still getting PHP version when I type php -v in the shell.

I thought about trying DotDeb (which I use for PHP7 on my production server), but these repos seem to be for Wheezy, not Jessie.

Anyways, I'd like to be able to install PHP 5.5, and use its built in web server.

How do I achieve that?

Thank you

  • Do you want both PHP 5.5 and 5.6 installed at the same time? That isn't clear from your question. – Faheem Mitha Mar 26 '16 at 16:59
  • @FaheemMitha I'd prefer not, but it's not mandatory. – Housemd Mar 26 '16 at 17:08
  • "I'd prefer not". I'm going to interpret that as - you don't want both versions installed at the same time. Downgrading 5.6 to 5.5 is probably not a difficult thing intrinsically. You could take your selection from snapshot.debian.org/package/php5. You'd have to rebuild your chosen version on jessie. But I'm curious why 5.5 works for you and 5.6 doesn't. What are you trying to do? Of course, bear in mind that none of those versions are supported, and might have security holes or whatever. It looks like 5.5 was never in a stable release of Debian, so you can't get it from there. – Faheem Mitha Mar 26 '16 at 17:25
  • It sounds like you want to do compatibility testing of some (your own?) php scripts with particular versions of php? if so, why not run wheezy in a VM and install php 5.5 on that, so you don't have to mess up your jessie laptop with old versions? making test environments is one of the great uses of virtual machines. – cas Mar 26 '16 at 23:06
  • @cas You're absolutely right. I want to test my own PHP scripts before I release them on Codecanyon. I've tested on PHP7 which I have on my AWS EC 2 and PHP5.6 which I have on my shared hosting account. I am supporting PHP5.5, so I needed to test on that version too, and I ended up simply installing that version on my Windows OS, and I'm gonna do the same for 5.4 and 5.3. – Housemd Mar 27 '16 at 8:09
2

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

  • I've decided to go for Ubuntu 16 and have PHP7 bundled in the OS natively. – Housemd Jul 4 '16 at 18:16
  • @Housemd a very wise move – twigg Jul 5 '16 at 8:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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