PHP FPM integration on SME Server. Let you run several versions of PHP (using SCL from Remi's repo) at the same time
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
887 B

#!/usr/bin/perl -w
use strict;
use warnings;
use esmith::ConfigDB;
my $c = esmith::ConfigDB->open_ro || die "Couldn't open the configuration database\n";
my @fpms = qw(
php-fpm
php56-php-fpm
php70-php-fpm
php71-php-fpm
);
# We need to ensure every versions are stopped, and only then start them all again
# so if we move a pool from one version to another, we won't have a socket conflict
foreach my $fpm (@fpms){
my $service = $c->get($fpm);
esmith::util::serviceControl(
NAME => $fpm,
ACTION => 'stop',
BACKGROUND => 'false')
or die "Unable to stop $fpm\n";
}
foreach my $fpm (@fpms){
my $service = $c->get($fpm);
if ($service && ($service->prop('status') || 'disabled') eq 'enabled'){
esmith::util::serviceControl(
NAME => $fpm,
ACTION => 'start',
BACKGROUND => 'false')
or die "Unable to start $fpm\n";
}
}