2

I have PHP 7.1 on my Ubuntu machine.

I need to work on a project that uses php5 5.3.3-7+squeeze17 (yes... a 10 year old code).

I have found the source of this package: https://launchpad.net/debian/+source/php5/5.3.3-7+squeeze17

If I install php5_5.3.3.orig.tar.gz following using any of these methods:

Will this corrupt my current PHP 7.1 and prevent it from working? (- might this change the settings via Apache2 on install make?)

What is the proper way to install this version, so I will be able to switch between both versions?

Kar19
  • 461
  • 1
  • 6
  • 27

1 Answers1

0

All security concerns left aside I stumbled upon a great tool which might help you a lot with building and managing multiple php versions in parallel:

phpbrew does a great job with easing the job of configuring php source to your needs and compiling it:

curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew
chmod +x phpbrew && sudo mv phpbrew /usr/local/bin/phpbrew
phpbrew init
echo '[[ -e ~/.phpbrew/bashrc ]] && source ~/.phpbrew/bashrc' >> .bashrc
source ~/.phpbrew/bashrc
phpbrew update
phpbrew install --old 5.3.29 +default +mysql +pdo +apxs2

Installation is done to your $HOME directory and you can set a default php version (i.e. /usr/bin/php)

phpbrew switch 7.2

and override your currently used/active php version by setting it temporarily

phpbrew use 5.3.29