info('Php-fpm installing...'); $output = []; exec('apt update 2>&1', $output); exec('apt install -y php-fpm '.self::PACKAGES.' 2>&1', $output); // @TODO apt add a Warning for no good, in a later version output will be scanned for helpfull infos $this->line(implode("\n", Install::filterAptMessages($output))); // scan for all versions foreach(scandir(self::FILE_PREFIX) as $directory) { // get path to www.conf $file = self::FILE_PREFIX.'/'.$directory.self::FILE_SUFFIX; if (file_exists($file)) { // get user $user = $this->option('user'); if ($user) { $this->info('Php-fpm change user...'); system('sed -i "s/user = www-data/user = '.$user.'/g" '.$file); system('sed -i "s/group = www-data/group = '.$user.'/g" '.$file); 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); } $this->info('Php-fpm change mode...'); 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); foreach ($output as $line) { system('service '.str_replace('.service', '', $line).' restart'); } } } // check if nginx is ready and installed if (Install::isReady('php-fpm')) { $this->info('Php-fpm installing...Success! \o/'); } else { $this->error('Failed! Please check log-file!'); } } }