Debian 9: PHP 5.6 - 7.2 with Sury and ISP

Discussion in 'Tips/Tricks/Mods' started by ztk.me, Jul 18, 2018.

Tags:
  1. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    If you happen to install a new Debian server using stretch and want to have multiple php versions, you might have seen https://deb.sury.org/

    I assume a fresh installation, else there might be the need to update all your vhosts ;)
    similar Howto: https://www.howtoforge.com/tutorial...fig-3-from-debian-packages-on-debian-8-and-9/
    worth reading ;)

    https://packages.sury.org/php/README.txt
    Get surys repo added to your system.

    Install the versions you want and also the modules you need. But make sure you got the -fpm packages.
    Code:
    apt-get install php5.6-fpm php7.1-fpm php7.2-fpm php 7.0-fpm ....
    
    Make sure there is max php7.1-fpm enabled as default php parser in your conf-enabled.
    At least if you use this to run your webmail/phpmyadmin webapplications.
    Code:
    a2disconf php-7.2-fpm
    a2disconf php7.0-fpm
    ...
    a2enconf php7.1-fpm
    
    This config kind of replaces mod_php behaviour, if you did not get rid of it yet, disable it and use apache mpm_worker ; or if you are on debian 10+ you can probably use mpm_event, don't use mpm_event on stretch if you haven't patched it manually!
    However this particular a2dis/en block following is optional
    Code:
    a2dismod mod_php...
    a2dismod mpm_prefork
    a2dismod mpm_event
    a2enmod mpm_worker
    
    If you did this however, also check
    https://www.howtoforge.com/communit...-enigma-munin-phpmyadmin-using-php-fpm.77489/
    https://www.howtoforge.com/communit...l-port-8080-with-lets-encrypt-free-ssl.75554/
    https://www.howtoforge.com/community/threads/pfs-letsencrypt-for-postfix-dovecot-pureftpd.77499/

    // end of optional

    Check the example www*.txt files on this thread, you need one default process running for all your php-fpm versions!
    copy them to your /etc/php/x.y/pool.d/www.conf

    In ISPConfig go to System>Serer configuration>Web and change accordingly to the picture.
    edit: I didn't bother with the apache php.ini setting, change it, too if you need it
    Making PHP 7.2 default, since your default $php -v command is linked to php 7.2, explain to your customers you provide different versions and they might need to adjust their cronjobs or cgi files using /usr/bin/php5.6 ... /usr/bin/php7.2

    Use the following values accordingly to add your additional PHP versions as fpm - because who wants fastcgi ( ahh you can figure that out ).

    if I didn't miss anything that should be it.
     

    Attached Files:

    Last edited: Jul 26, 2018
    till likes this.
  2. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    on debian 9 at least php 7.1 does not load curl extension in some circumstances
    This can happen, if you have installed a local version of curl and or openssl ( similar ) to your /usr/local/lib folder.
    Either remove them or do some hacks to prevent it from loading ;)
    Use a different folder for your older php support files
     
    Last edited: Jul 25, 2018

Share This Page