|
@ -46,6 +46,8 @@ class PhpFpmInstallCommand extends Command |
|
|
{ |
|
|
{ |
|
|
$this->info('Php-fpm installing...'); |
|
|
$this->info('Php-fpm installing...'); |
|
|
|
|
|
|
|
|
|
|
|
$output = []; |
|
|
|
|
|
|
|
|
exec('apt update 2>&1', $output); |
|
|
exec('apt update 2>&1', $output); |
|
|
exec('apt install -y php-fpm '.self::PACKAGES.' 2>&1', $output); |
|
|
exec('apt install -y php-fpm '.self::PACKAGES.' 2>&1', $output); |
|
|
|
|
|
|
|
@ -64,24 +66,24 @@ class PhpFpmInstallCommand extends Command |
|
|
$user = $this->option('user'); |
|
|
$user = $this->option('user'); |
|
|
|
|
|
|
|
|
if ($user) { |
|
|
if ($user) { |
|
|
$output = []; |
|
|
|
|
|
|
|
|
|
|
|
$this->info('Php-fpm change user...'); |
|
|
$this->info('Php-fpm change user...'); |
|
|
exec('sed -i "s/user = www-data/user = '.$user.'/g" '.$file, $output); |
|
|
|
|
|
exec('sed -i "s/group = www-data/group = '.$user.'/g" '.$file, $output); |
|
|
|
|
|
|
|
|
system('sed -i "s/user = www-data/user = '.$user.'/g" '.$file); |
|
|
|
|
|
system('sed -i "s/group = www-data/group = '.$user.'/g" '.$file); |
|
|
|
|
|
|
|
|
exec('sed -i "s/listen.owner = www-data/listen.owner = '.$user.'/g" '.$file, $output); |
|
|
|
|
|
exec('sed -i "s/listen.group = www-data/listen.group = '.$user.'/g" '.$file, $output); |
|
|
|
|
|
|
|
|
|
|
|
$this->line(implode("\n", $output)); |
|
|
|
|
|
|
|
|
system('sed -i "s/listen.owner = www-data/listen.owner = '.$user.'/g" '.$file); |
|
|
|
|
|
system('sed -i "s/listen.group = www-data/listen.group = '.$user.'/g" '.$file); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$output = []; |
|
|
|
|
|
|
|
|
|
|
|
$this->info('Php-fpm change mode...'); |
|
|
$this->info('Php-fpm change mode...'); |
|
|
exec('sed -i "s/;listen.mode = 0660/listen.mode = 0660/g" '.$file, $output); |
|
|
|
|
|
|
|
|
system('sed -i "s/;listen.mode = 0660/listen.mode = 0660/g" '.$file); |
|
|
|
|
|
|
|
|
|
|
|
// getting version and restart service
|
|
|
|
|
|
$output = []; |
|
|
|
|
|
exec("systemctl --full --type service --all | awk '{print $1}' | egrep php.+?fpm.service", $output); |
|
|
|
|
|
|
|
|
$this->line(implode("\n", $output)); |
|
|
|
|
|
|
|
|
foreach ($output as $line) { |
|
|
|
|
|
system('service '.str_replace('.service', '', $line).' restart'); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|