38

After 3 hours of struggle, I was able to setup multiple versions of PHP and configured easy switching on Apache on a fresh install of elementary OS.

Comments
  • 5
    Welcome to the world of "everything is possible (except nvidia)" hehe
  • 2
    You can easily run PHP 5.6, 7.0 and 7.1 beside each other if you are using fpm (which everyone should use)
  • 0
    Vagrant, anyone? Have several projects with several "version" needs, eaxh with its vagrant machine.
  • 0
    @pagongski
    That is actually unessecary complex.
    :)
    There is much easier ways to do it and it is supported.
  • 0
    @Linux I'm all ears for easier tools/processes. You mentioned fpm. Github - jordansissel?

    Please share those easier ways. :)
  • 2
    You should give a try to Docker
  • 2
    @pagongski

    It is super easy actually,
    Install php-fpm for 5.6, 7.0 and 7.1.
    enable mod_proxy, proxy_fcgi in apache

    Add this to you virtualhost:
    ProxyPassMatch ^/(.*\.php(/.*)?)$ unix:///run/YOURPHPPOOL|fcgi:/... retry=1

    modify the phppool conf in /etc/php/7.0/fpm/pool.d/
  • 1
    @Obfuscator yes, thats another interesting way to do things like this.
  • 1
    @Linux ah ok, i understand. But i thought you meant different versions of not only php but everything else, i.e. mysql, postgresql, etc. All the inevitable stuff related to a project. Sometimes i have those requirements and with vagrant (or even docker, like mentioned above) we can contain everything easily.

    Still, great tip for php. And much lighter. Thanks. :)
  • 0
    @pagongski
    Oh, I understand then :)
  • 0
    I too have wasted a few hours trying this. It feels it should be easier.
Add Comment