Centos 7 > Multi PHP from Remi repos > php-fpm init script

Discussion in 'ISPConfig 3 Priority Support' started by Madalin Ignisca, Nov 7, 2015.

  1. Madalin Ignisca

    Madalin Ignisca New Member

    I'm trying a setup using ISPConfig current stable (3.0.5) on Centos 7 with Epel and Remi repos enabled.
    I've added additional PHP versions from Remi's repos that go into /opt/remi/php5X each.
    They can manually be started/restarted using 'systemctl start/restart php5X-php-fpm'.
    I've set that each PHP-FPM pool to start from different range of ports, like 15400 for PHP 5.4, 15500 for PHP 5.5.
    If I create a website and set to use one of this PHP, it works only if I manually restart after 1 minute the needed PHP service.
    Init scripts are located in the standard directory, for example: '/usr/lib/systemd/system/php56-php-fpm.service'
    I belive that the additional PHP versions in ISPConfig expect an init script similar/compatible to the ones from Centos 5/6.
    How could I do something to get services restarted?
    Would some wrapper scripts that would do the restart work?
    I find using the SoftwareCollection additional PHP versions easier to maintain and would like to stick to them.
    PS: Thanks for this great Control Panel and keep up the good work.
  2. Madalin Ignisca

    Madalin Ignisca New Member

    I managed to get it working with a "hack" by editing 'server/mods-available/web_module.inc.php' on the init command for php-fpm for Centos 7:
    from: 'systemctl restart php-fpm.service'
    to: 'systemctl restart php-fpm && systemctl reload php54-php-fpm && systemctl reload php55-php-fpm && systemctl reload php56-php-fpm && systemctl restart php-fpm && systemctl reload php54-php-fpm && systemctl reload php55-php-fpm && systemctl reload php56-php-fpm'

    I've duplicated the restart and reload as when switching between php versions for a site restarting or reloading the service was failing as previous tcp port was already in use by previous php-pool and it needed to be killed.

    I've left 'reload' on php54/php55/php56 installed from Remi's repos as those are not buggy on reload, just the default from the distribution failing on reload (something kills first the service, maybe it's from the ispconfig script somewhere, I'll research on that).

    I prefer to do 'reload' as this keeps the cache (Opcache/Apcu) for the other sites and the clients are more happy this way.

    Hope this would help for the next Ispconfig version when having additional PHP-FPM services to restart/reload.


Share This Page