diff --git a/actions/admin/settings/122.froxlorvhost.php b/actions/admin/settings/122.froxlorvhost.php index 5ddbfc30..6175bb73 100644 --- a/actions/admin/settings/122.froxlorvhost.php +++ b/actions/admin/settings/122.froxlorvhost.php @@ -80,19 +80,6 @@ return array( 'save_method' => 'storeSettingField', 'visible' => Settings::Get('system.use_ssl') ), - 'system_http2_support' => array( - 'label' => $lng['serversettings']['http2_support'], - 'settinggroup' => 'system', - 'varname' => 'http2_support', - 'type' => 'bool', - 'default' => false, - 'save_method' => 'storeSettingField', - 'websrv_avail' => array( - 'apache2', - 'nginx' - ), - 'visible' => Settings::Get('system.use_ssl') - ), /** * FCGID */ diff --git a/actions/admin/settings/130.webserver.php b/actions/admin/settings/130.webserver.php index 4caa875f..84e81f18 100644 --- a/actions/admin/settings/130.webserver.php +++ b/actions/admin/settings/130.webserver.php @@ -60,6 +60,19 @@ return array( 'apache2' ) ), + 'system_http2_support' => array( + 'label' => $lng['serversettings']['http2_support'], + 'settinggroup' => 'system', + 'varname' => 'http2_support', + 'type' => 'bool', + 'default' => false, + 'save_method' => 'storeSettingField', + 'websrv_avail' => array( + 'apache2', + 'nginx' + ), + 'visible' => Settings::Get('system.use_ssl') + ), 'system_httpuser' => array( 'label' => $lng['admin']['webserver_user'], 'settinggroup' => 'system', diff --git a/admin_phpsettings.php b/admin_phpsettings.php index 6192fb42..f4b2df20 100644 --- a/admin_phpsettings.php +++ b/admin_phpsettings.php @@ -79,6 +79,10 @@ if ($page == 'overview') { while ($row = $configs->fetch(PDO::FETCH_ASSOC)) { $fpmconfigs .= makeoption($row['description'], $row['id'], 1, true, true); } + + $pm_select = makeoption('static', 'static', 'static', true, true); + $pm_select.= makeoption('dynamic', 'dynamic', 'static', true, true); + $pm_select.= makeoption('ondemand', 'ondemand', 'static', true, true); $phpconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php'; $phpconfig_add_form = htmlform::genHTMLForm($phpconfig_add_data); @@ -155,7 +159,11 @@ if ($page == 'overview') { while ($row = $configs->fetch(PDO::FETCH_ASSOC)) { $fpmconfigs .= makeoption($row['description'], $row['id'], $result['fpmsettingid'], true, true); } - + + $pm_select = makeoption('static', 'static', $result['pm'], true, true); + $pm_select.= makeoption('dynamic', 'dynamic', $result['pm'], true, true); + $pm_select.= makeoption('ondemand', 'ondemand', $result['pm'], true, true); + $phpconfig_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php'; $phpconfig_edit_form = htmlform::genHTMLForm($phpconfig_edit_data); diff --git a/install/froxlor.sql b/install/froxlor.sql index fd52390c..2d15204b 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -406,21 +406,12 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('login', 'maxloginattempts', '3'), ('login', 'deactivatetime', '900'), ('phpfpm', 'enabled', '0'), - ('phpfpm', 'configdir', '/etc/php-fpm.d/'), - ('phpfpm', 'reload', '/etc/init.d/php-fpm restart'), - ('phpfpm', 'pm', 'static'), - ('phpfpm', 'max_children', '1'), - ('phpfpm', 'start_servers', '20'), - ('phpfpm', 'min_spare_servers', '5'), - ('phpfpm', 'max_spare_servers', '35'), - ('phpfpm', 'max_requests', '0'), ('phpfpm', 'tmpdir', '/var/customers/tmp/'), ('phpfpm', 'peardir', '/usr/share/php/:/usr/share/php5/'), ('phpfpm', 'envpath', '/usr/local/bin:/usr/bin:/bin'), ('phpfpm', 'enabled_ownvhost', '0'), ('phpfpm', 'vhost_httpuser', 'froxlorlocal'), ('phpfpm', 'vhost_httpgroup', 'froxlorlocal'), - ('phpfpm', 'idle_timeout', '30'), ('phpfpm', 'aliasconfigdir', '/var/www/php-fpm/'), ('phpfpm', 'defaultini', '1'), ('phpfpm', 'vhost_defaultini', '2'), @@ -696,7 +687,7 @@ opcache.interned_strings_buffer'), ('panel', 'password_special_char', '!?<>§$%+#=@'), ('panel', 'customer_hide_options', ''), ('panel', 'version', '0.10.0'), - ('panel', 'db_version', '201809180'); + ('panel', 'db_version', '201809280'); DROP TABLE IF EXISTS `panel_tasks`; @@ -904,6 +895,15 @@ CREATE TABLE `panel_phpconfigs` ( `phpsettings` text NOT NULL, `fpmsettingid` int(11) NOT NULL DEFAULT '1', `pass_authorizationheader` tinyint(1) NOT NULL default '0', + `override_fpmconfig` tinyint(1) NOT NULL DEFAULT '0', + `pm` varchar(15) NOT NULL DEFAULT 'static', + `max_children` int(4) NOT NULL DEFAULT '1', + `start_servers` int(4) NOT NULL DEFAULT '20', + `min_spare_servers` int(4) NOT NULL DEFAULT '5', + `max_spare_servers` int(4) NOT NULL DEFAULT '35', + `max_requests` int(4) NOT NULL DEFAULT '0', + `idle_timeout` int(4) NOT NULL DEFAULT '30', + `limit_extensions` varchar(255) NOT NULL default '.php', PRIMARY KEY (`id`), KEY `fpmsettingid` (`fpmsettingid`) ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci; diff --git a/install/updates/froxlor/0.9/update_0.9.inc.php b/install/updates/froxlor/0.9/update_0.9.inc.php index 6b07bc11..6aeea723 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -4011,3 +4011,52 @@ if (isDatabaseVersion('201805290')) { updateToDbVersion('201809180'); } + +if (isDatabaseVersion('201809180')) { + + showUpdateStep("Adding new fields for php configs"); + Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `override_fpmconfig` tinyint(1) NOT NULL DEFAULT '0';"); + Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `pm` varchar(15) NOT NULL DEFAULT 'static';"); + Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `max_children` int(4) NOT NULL DEFAULT '1';"); + Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `start_servers` int(4) NOT NULL DEFAULT '20';"); + Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `min_spare_servers` int(4) NOT NULL DEFAULT '5';"); + Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `max_spare_servers` int(4) NOT NULL DEFAULT '35';"); + Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `max_requests` int(4) NOT NULL DEFAULT '0';"); + Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `idle_timeout` int(4) NOT NULL DEFAULT '30';"); + Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `limit_extensions` varchar(255) NOT NULL default '.php';"); + lastStepStatus(0); + + showUpdateStep("Synchronize fpm-daemon process manager settings with php-configs"); + // get all fpm-daemons + $sel_stmt = Database::prepare("SELECT * FROM `panel_fpmdaemons`;"); + Database::pexecute($sel_stmt); + $fpm_daemons = $sel_stmt->fetchAll(PDO::FETCH_ASSOC); + $upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_PHPCONFIGS . "` SET + `pm` = :pm, + `max_children` = :maxc, + `start_servers` = :starts, + `min_spare_servers` = :minss, + `max_spare_servers` = :maxss, + `max_requests` = :maxr, + `idle_timeout` = :it, + `limit_extensions` = :le + WHERE `fpmsettingid` = :fpmid + "); + // update all php-configs with the pm data from the fpm-daemon + foreach ($fpm_daemons as $fpm_daemon) { + Database::pexecute($upd_stmt, array( + 'pm' => $fpm_daemon['pm'], + 'maxc' => $fpm_daemon['max_children'], + 'starts' => $fpm_daemon['start_servers'], + 'minss' => $fpm_daemon['min_spare_servers'], + 'maxss' => $fpm_daemon['max_spare_servers'], + 'maxr' => $fpm_daemon['max_requests'], + 'it' => $fpm_daemon['idle_timeout'], + 'le' => $fpm_daemon['limit_extensions'], + 'fpmid' => $fpm_daemon['id'] + )); + } + lastStepStatus(0); + + updateToDbVersion('201809280'); +} diff --git a/lib/classes/api/commands/class.PhpSettings.php b/lib/classes/api/commands/class.PhpSettings.php index 72d3d2e9..52614506 100644 --- a/lib/classes/api/commands/class.PhpSettings.php +++ b/lib/classes/api/commands/class.PhpSettings.php @@ -146,6 +146,7 @@ class PhpSettings extends ApiCommand implements ResourceEntity if (Settings::Get('system.mod_fcgid') == 1) { $binary = $this->getParam('binary'); + $fpm_config_id = 1; } elseif (Settings::Get('phpfpm.enabled') == 1) { $fpm_config_id = intval($this->getParam('fpmconfig')); } @@ -160,6 +161,19 @@ class PhpSettings extends ApiCommand implements ResourceEntity $fpm_reqslowtimeout = $this->getParam('phpfpm_reqslowtimeout', true, "5s"); $fpm_pass_authorizationheader = $this->getParam('phpfpm_pass_authorizationheader', true, 0); + $override_fpmconfig = $this->getParam('override_fpmconfig', true, 0); + $def_fpmconfig = $this->apiCall('FpmDaemons.get', array( + 'id' => $fpm_config_id + )); + $pmanager = $this->getParam('pm', true, $def_fpmconfig['pm']); + $max_children = $this->getParam('max_children', true, $def_fpmconfig['max_children']); + $start_servers = $this->getParam('start_servers', true, $def_fpmconfig['start_servers']); + $min_spare_servers = $this->getParam('min_spare_servers', true, $def_fpmconfig['min_spare_servers']); + $max_spare_servers = $this->getParam('max_spare_servers', true, $def_fpmconfig['max_spare_servers']); + $max_requests = $this->getParam('max_requests', true, $def_fpmconfig['max_requests']); + $idle_timeout = $this->getParam('idle_timeout', true, $def_fpmconfig['idle_timeout']); + $limit_extensions = $this->getParam('limit_extensions', true, $def_fpmconfig['limit_extensions']); + // validation $description = validate($description, 'description', '', '', array(), true); $phpsettings = validate(str_replace("\r\n", "\n", $phpsettings), 'phpsettings', '/^[^\0]*$/', '', array(), true); @@ -181,9 +195,22 @@ class PhpSettings extends ApiCommand implements ResourceEntity $fpm_reqtermtimeout = 0; $fpm_reqslowtimeout = 0; $fpm_pass_authorizationheader = 0; + $override_fpmconfig = 0; } elseif (Settings::Get('phpfpm.enabled') == 1) { $fpm_reqtermtimeout = validate($fpm_reqtermtimeout, 'phpfpm_reqtermtimeout', '/^([0-9]+)(|s|m|h|d)$/', '', array(), true); $fpm_reqslowtimeout = validate($fpm_reqslowtimeout, 'phpfpm_reqslowtimeout', '/^([0-9]+)(|s|m|h|d)$/', '', array(), true); + if (! in_array($pmanager, array( + 'static', + 'dynamic', + 'ondemand' + ))) { + throw new ErrorException("Unknown process manager", 406); + } + if (empty($limit_extensions)) { + $limit_extensions = '.php'; + } + $limit_extensions = validate($limit_extensions, 'limit_extensions', '/^(\.[a-z]([a-z0-9]+)\ ?)+$/', '', array(), true); + // disable fcgid stuff $binary = '/usr/bin/php-cgi'; $file_extensions = 'php'; @@ -209,7 +236,16 @@ class PhpSettings extends ApiCommand implements ResourceEntity `fpm_reqslow` = :fpmreqslow, `phpsettings` = :phpsettings, `fpmsettingid` = :fpmsettingid, - `pass_authorizationheader` = :fpmpassauth + `pass_authorizationheader` = :fpmpassauth, + `override_fpmconfig` = :ofc, + `pm` = :pm, + `max_children` = :max_children, + `start_servers` = :start_servers, + `min_spare_servers` = :min_spare_servers, + `max_spare_servers` = :max_spare_servers, + `max_requests` = :max_requests, + `idle_timeout` = :idle_timeout, + `limit_extensions` = :limit_extensions "); $ins_data = array( 'desc' => $description, @@ -223,7 +259,16 @@ class PhpSettings extends ApiCommand implements ResourceEntity 'fpmreqslow' => $fpm_reqslowtimeout, 'phpsettings' => $phpsettings, 'fpmsettingid' => $fpm_config_id, - 'fpmpassauth' => $fpm_pass_authorizationheader + 'fpmpassauth' => $fpm_pass_authorizationheader, + 'ofc' => $override_fpmconfig, + 'pm' => $pmanager, + 'max_children' => $max_children, + 'start_servers' => $start_servers, + 'min_spare_servers' => $min_spare_servers, + 'max_spare_servers' => $max_spare_servers, + 'max_requests' => $max_requests, + 'idle_timeout' => $idle_timeout, + 'limit_extensions' => $limit_extensions ); Database::pexecute($ins_stmt, $ins_data, true, true); $ins_data['id'] = Database::lastInsertId(); @@ -272,7 +317,16 @@ class PhpSettings extends ApiCommand implements ResourceEntity $fpm_reqtermtimeout = $this->getParam('phpfpm_reqtermtimeout', true, $result['fpm_reqterm']); $fpm_reqslowtimeout = $this->getParam('phpfpm_reqslowtimeout', true, $result['fpm_reqslow']); $fpm_pass_authorizationheader = $this->getParam('phpfpm_pass_authorizationheader', true, $result['pass_authorizationheader']); - + $override_fpmconfig = $this->getParam('override_fpmconfig', true, $result['override_fpmconfig']); + $pmanager = $this->getParam('pm', true, $result['pm']); + $max_children = $this->getParam('max_children', true, $result['max_children']); + $start_servers = $this->getParam('start_servers', true, $result['start_servers']); + $min_spare_servers = $this->getParam('min_spare_servers', true, $result['min_spare_servers']); + $max_spare_servers = $this->getParam('max_spare_servers', true, $result['max_spare_servers']); + $max_requests = $this->getParam('max_requests', true, $result['max_requests']); + $idle_timeout = $this->getParam('idle_timeout', true, $result['idle_timeout']); + $limit_extensions = $this->getParam('limit_extensions', true, $result['limit_extensions']); + // validation $description = validate($description, 'description', '', '', array(), true); $phpsettings = validate(str_replace("\r\n", "\n", $phpsettings), 'phpsettings', '/^[^\0]*$/', '', array(), true); @@ -294,9 +348,22 @@ class PhpSettings extends ApiCommand implements ResourceEntity $fpm_reqtermtimeout = 0; $fpm_reqslowtimeout = 0; $fpm_pass_authorizationheader = 0; + $override_fpmconfig = 0; } elseif (Settings::Get('phpfpm.enabled') == 1) { $fpm_reqtermtimeout = validate($fpm_reqtermtimeout, 'phpfpm_reqtermtimeout', '/^([0-9]+)(|s|m|h|d)$/', '', array(), true); $fpm_reqslowtimeout = validate($fpm_reqslowtimeout, 'phpfpm_reqslowtimeout', '/^([0-9]+)(|s|m|h|d)$/', '', array(), true); + if (! in_array($pmanager, array( + 'static', + 'dynamic', + 'ondemand' + ))) { + throw new ErrorException("Unknown process manager", 406); + } + if (empty($limit_extensions)) { + $limit_extensions = '.php'; + } + $limit_extensions = validate($limit_extensions, 'limit_extensions', '/^(\.[a-z]([a-z0-9]+)\ ?)+$/', '', array(), true); + // disable fcgid stuff $binary = '/usr/bin/php-cgi'; $file_extensions = 'php'; @@ -322,7 +389,16 @@ class PhpSettings extends ApiCommand implements ResourceEntity `fpm_reqslow` = :fpmreqslow, `phpsettings` = :phpsettings, `fpmsettingid` = :fpmsettingid, - `pass_authorizationheader` = :fpmpassauth + `pass_authorizationheader` = :fpmpassauth, + `override_fpmconfig` = :ofc, + `pm` = :pm, + `max_children` = :max_children, + `start_servers` = :start_servers, + `min_spare_servers` = :min_spare_servers, + `max_spare_servers` = :max_spare_servers, + `max_requests` = :max_requests, + `idle_timeout` = :idle_timeout, + `limit_extensions` = :limit_extensions WHERE `id` = :id "); $upd_data = array( @@ -338,6 +414,15 @@ class PhpSettings extends ApiCommand implements ResourceEntity 'phpsettings' => $phpsettings, 'fpmsettingid' => $fpm_config_id, 'fpmpassauth' => $fpm_pass_authorizationheader, + 'ofc' => $override_fpmconfig, + 'pm' => $pmanager, + 'max_children' => $max_children, + 'start_servers' => $start_servers, + 'min_spare_servers' => $min_spare_servers, + 'max_spare_servers' => $max_spare_servers, + 'max_requests' => $max_requests, + 'idle_timeout' => $idle_timeout, + 'limit_extensions' => $limit_extensions, 'id' => $id ); Database::pexecute($upd_stmt, $upd_data, true, true); diff --git a/lib/classes/phpinterface/class.phpinterface_fpm.php b/lib/classes/phpinterface/class.phpinterface_fpm.php index 8ec93b3e..6e9c67ce 100644 --- a/lib/classes/phpinterface/class.phpinterface_fpm.php +++ b/lib/classes/phpinterface/class.phpinterface_fpm.php @@ -91,6 +91,18 @@ class phpinterface_fpm $fh = @fopen($this->getConfigFile(), 'w'); if ($fh) { + + if ($phpconfig['override_fpmconfig'] == 1) { + $this->_fpm_cfg['pm'] = $phpconfig['pm']; + $this->_fpm_cfg['max_children'] = $phpconfig['max_children']; + $this->_fpm_cfg['start_servers'] = $phpconfig['start_servers']; + $this->_fpm_cfg['min_spare_servers'] = $phpconfig['min_spare_servers']; + $this->_fpm_cfg['max_spare_servers'] = $phpconfig['max_spare_servers']; + $this->_fpm_cfg['max_requests'] = $phpconfig['max_requests']; + $this->_fpm_cfg['idle_timeout'] = $phpconfig['idle_timeout']; + $this->_fpm_cfg['limit_extensions'] = $phpconfig['limit_extensions']; + } + $fpm_pm = $this->_fpm_cfg['pm']; $fpm_children = (int) $this->_fpm_cfg['max_children']; $fpm_start_servers = (int) $this->_fpm_cfg['start_servers']; diff --git a/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php b/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php index 6d30adfd..73ca458e 100644 --- a/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php +++ b/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php @@ -99,6 +99,70 @@ return array( ), 'value' => array() ), + 'override_fpmconfig' => array( + 'label' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig'], + 'type' => 'checkbox', + 'values' => array( + array ('label' => $lng['panel']['yes'], 'value' => '1') + ), + 'value' => array() + ), + 'pm' => array( + 'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'label' => $lng['serversettings']['phpfpm_settings']['pm'], + 'desc' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], + 'type' => 'select', + 'select_var' => $pm_select + ), + 'max_children' => array( + 'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'], + 'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], + 'type' => 'int', + 'value' => 1 + ), + 'start_servers' => array( + 'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'], + 'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], + 'type' => 'int', + 'value' => 20 + ), + 'min_spare_servers' => array( + 'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'], + 'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], + 'type' => 'int', + 'value' => 5 + ), + 'max_spare_servers' => array( + 'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'], + 'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], + 'type' => 'int', + 'value' => 35 + ), + 'max_requests' => array( + 'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'], + 'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], + 'type' => 'int', + 'value' => 0 + ), + 'idle_timeout' => array( + 'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'], + 'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], + 'type' => 'int', + 'value' => 30 + ), + 'limit_extensions' => array( + 'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'label' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['title'], + 'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], + 'type' => 'text', + 'value' => '.php' + ), 'phpsettings' => array( 'style' => 'align-top', 'label' => $lng['admin']['phpsettings']['phpinisettings'], diff --git a/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php b/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php index e2e8fd11..080a80d7 100644 --- a/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php +++ b/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php @@ -102,6 +102,70 @@ return array( ), 'value' => array($result['pass_authorizationheader']) ), + 'override_fpmconfig' => array( + 'label' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig'], + 'type' => 'checkbox', + 'values' => array( + array ('label' => $lng['panel']['yes'], 'value' => '1') + ), + 'value' => array($result['override_fpmconfig']) + ), + 'pm' => array( + 'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'label' => $lng['serversettings']['phpfpm_settings']['pm'], + 'desc' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], + 'type' => 'select', + 'select_var' => $pm_select + ), + 'max_children' => array( + 'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'], + 'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], + 'type' => 'int', + 'value' => $result['max_children'] + ), + 'start_servers' => array( + 'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'], + 'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], + 'type' => 'int', + 'value' => $result['start_servers'] + ), + 'min_spare_servers' => array( + 'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'], + 'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], + 'type' => 'int', + 'value' => $result['min_spare_servers'] + ), + 'max_spare_servers' => array( + 'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'], + 'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], + 'type' => 'int', + 'value' => $result['max_spare_servers'] + ), + 'max_requests' => array( + 'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'], + 'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], + 'type' => 'int', + 'value' => $result['max_requests'] + ), + 'idle_timeout' => array( + 'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'], + 'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], + 'type' => 'int', + 'value' => $result['idle_timeout'] + ), + 'limit_extensions' => array( + 'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false), + 'label' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['title'], + 'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], + 'type' => 'text', + 'value' => $result['limit_extensions'] + ), 'phpsettings' => array( 'style' => 'align-top', 'label' => $lng['admin']['phpsettings']['phpinisettings'], diff --git a/lib/version.inc.php b/lib/version.inc.php index f03c7d41..11d224ce 100644 --- a/lib/version.inc.php +++ b/lib/version.inc.php @@ -19,7 +19,7 @@ $version = '0.10.0'; // Database version (YYYYMMDDC where C is a daily counter) -$dbversion = '201809180'; +$dbversion = '201809280'; // Distribution branding-tag (used for Debian etc.) $branding = ''; diff --git a/lng/english.lng.php b/lng/english.lng.php index 285037db..16699484 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -2127,6 +2127,8 @@ $lng['admin']['plans']['use_plan'] = 'Apply plan'; $lng['question']['plan_reallydelete'] = 'Do you really want to delete the hosting plan %s?'; $lng['admin']['notryfiles']['title'] = 'No autogenerated try_files'; $lng['admin']['notryfiles']['description'] = 'Say yes here if you want to specify a custom try_files directive in specialsettings (needed for some wordpress plugins for example).'; +$lng['serversettings']['phpfpm_settings']['override_fpmconfig'] = 'Override FPM-daemon settings (pm, max_children, etc.)'; +$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'] = '
Only used if "Override FPM-daemon settings" is set to "Yes"'; // added in froxlor 0.10.0 $lng['panel']['none_value'] = 'None'; diff --git a/lng/german.lng.php b/lng/german.lng.php index b4e6939b..45322e59 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1777,6 +1777,8 @@ $lng['admin']['plans']['use_plan'] = 'Plan übernehmen'; $lng['question']['plan_reallydelete'] = 'Wollen Sie den Hosting-Plan "%s" wirklich löschen?'; $lng['admin']['notryfiles']['title'] = 'Keine generierte try_files Anweisung'; $lng['admin']['notryfiles']['description'] = 'Wähle "Ja", wenn eine eigene try_files Direktive in den "eigenen Vhost Einstellungen" angegeben werden soll (z.B. nötig für manche Wordpress Plugins).'; +$lng['serversettings']['phpfpm_settings']['override_fpmconfig'] = 'Überschreibe FPM-Daemon Einstellungen (pm, max_children, etc.)'; +$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'] = '
Nur verwendet wenn "Überschreibe FPM-Daemon Einstellungen" auf "Ja" gestellt ist'; // added in froxlor 0.10.0 $lng['panel']['none_value'] = 'Keine';