1

I'm just a developer, but I can't think of a more adequate forum for my question: After upgrading to ubuntu 16.04 the standard version of php is 7.0. For my purposes it would be best anyway to have a setup, that allows to

  • either choose in the vhost-config-files, which php-version to use
  • or switch easily from one version to another

I would need php 5.4 and 5.5 as an option. So I asked google and tried the solutions I found, but couldnt get none of them working.

I'm stuck at this situation:
Tried some solutions with ppa:ondrej/php, but this broke my package management.
Installed apache-dev, php7.0 and phpbrew. Managed to build php 5.5.38 via phpbrew, tested on shell.

Then I tried to adapt this answer to my actual situation.
But a lot of things are different in ubuntu 16.04, and after several days of reading and trying I come back to this question:

How to install, keep up-to-date and use that three php versions 7.0, 5.5, 5.4 for apache 2.4 in ubuntu 16.04?

Thanks
Ejoo

P.S. offline for some hours now

ejoo
  • 13
  • 6

1 Answers1

3

There has to be a very good reason to use unsupported versions of PHP, such as 5.4 and 5.5, which are not even receiving security updates any more.

In any case, and ignoring that fact, nowadays, the easiest way by far to achieve this is by using containers, because it completely eliminates the dependency problems, and keeps the host OS clean from PHP.

The Docker Hub official PHP image supports versions from 5.6.29 to 7.1.0.

It is trivial to have a web server (containerised or not) acting as a proxy using Virtual Hosts to front those PHP containers running different versions of PHP.

If you really want to run an unsupported version of PHP, you will need to write a custom Dockerfile. You can use the upstream repository as a reference.

dawud
  • 14,918
  • 3
  • 41
  • 61
  • Thank you, that's a totally different approach, I'll try. The reasons are dependencies of typo3-installations I copy to maintain and update - to get rid of the old versions. – ejoo Dec 22 '16 at 09:03
  • I managed to get it running follwing this post: [link](https://stackoverflow.com/questions/32195108/docker-run-apache-on-host-and-container-for-different-websites/32209615#32209615). – ejoo Dec 23 '16 at 09:59
  • whoops, too fast and can't edit my own comment?? Still need to improve my solution, customising Dockerfiles from upstream repository. Thanks dawud! – ejoo Dec 23 '16 at 10:08