update php-fpm defaults; update paths for current stable php-7.3; read froxlor default php.ini from file rather then using phpconfig with id=1; fixes #796
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -81,8 +81,16 @@ if ($page == 'overview') {
|
|||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = 1");
|
if (file_exists(\Froxlor\Froxlor::getInstallDir() . '/templates/misc/php/default.ini.php')) {
|
||||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
require_once \Froxlor\Froxlor::getInstallDir() . '/templates/misc/php/default.ini.php';
|
||||||
|
$result = [
|
||||||
|
'phpsettings' => DEFAULT_PHPINI
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
// use first php-config as fallback
|
||||||
|
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = 1");
|
||||||
|
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
|
}
|
||||||
|
|
||||||
$fpmconfigs = '';
|
$fpmconfigs = '';
|
||||||
$configs = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC");
|
$configs = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC");
|
||||||
@@ -90,9 +98,9 @@ if ($page == 'overview') {
|
|||||||
$fpmconfigs .= \Froxlor\UI\HTML::makeoption($row['description'], $row['id'], 1, true, true);
|
$fpmconfigs .= \Froxlor\UI\HTML::makeoption($row['description'], $row['id'], 1, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$pm_select = \Froxlor\UI\HTML::makeoption('static', 'static', 'static', true, true);
|
$pm_select = \Froxlor\UI\HTML::makeoption('static', 'static', 'dynamic', true, true);
|
||||||
$pm_select .= \Froxlor\UI\HTML::makeoption('dynamic', 'dynamic', 'static', true, true);
|
$pm_select .= \Froxlor\UI\HTML::makeoption('dynamic', 'dynamic', 'dynamic', true, true);
|
||||||
$pm_select .= \Froxlor\UI\HTML::makeoption('ondemand', 'ondemand', 'static', true, true);
|
$pm_select .= \Froxlor\UI\HTML::makeoption('ondemand', 'ondemand', 'dynamic', true, true);
|
||||||
|
|
||||||
$phpconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php';
|
$phpconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php';
|
||||||
$phpconfig_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($phpconfig_add_data);
|
$phpconfig_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($phpconfig_add_data);
|
||||||
@@ -234,9 +242,9 @@ if ($page == 'overview') {
|
|||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$pm_select = \Froxlor\UI\HTML::makeoption('static', 'static', 'static', true, true);
|
$pm_select = \Froxlor\UI\HTML::makeoption('static', 'static', 'dynamic', true, true);
|
||||||
$pm_select .= \Froxlor\UI\HTML::makeoption('dynamic', 'dynamic', 'static', true, true);
|
$pm_select .= \Froxlor\UI\HTML::makeoption('dynamic', 'dynamic', 'dynamic', true, true);
|
||||||
$pm_select .= \Froxlor\UI\HTML::makeoption('ondemand', 'ondemand', 'static', true, true);
|
$pm_select .= \Froxlor\UI\HTML::makeoption('ondemand', 'ondemand', 'dynamic', true, true);
|
||||||
|
|
||||||
$fpmconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php';
|
$fpmconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php';
|
||||||
$fpmconfig_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($fpmconfig_add_data);
|
$fpmconfig_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($fpmconfig_add_data);
|
||||||
|
|||||||
@@ -842,13 +842,13 @@ CREATE TABLE `panel_fpmdaemons` (
|
|||||||
`description` varchar(50) NOT NULL,
|
`description` varchar(50) NOT NULL,
|
||||||
`reload_cmd` varchar(255) NOT NULL,
|
`reload_cmd` varchar(255) NOT NULL,
|
||||||
`config_dir` varchar(255) NOT NULL,
|
`config_dir` varchar(255) NOT NULL,
|
||||||
`pm` varchar(15) NOT NULL DEFAULT 'static',
|
`pm` varchar(15) NOT NULL DEFAULT 'dynamic',
|
||||||
`max_children` int(4) NOT NULL DEFAULT '1',
|
`max_children` int(4) NOT NULL DEFAULT '5',
|
||||||
`start_servers` int(4) NOT NULL DEFAULT '20',
|
`start_servers` int(4) NOT NULL DEFAULT '2',
|
||||||
`min_spare_servers` int(4) NOT NULL DEFAULT '5',
|
`min_spare_servers` int(4) NOT NULL DEFAULT '1',
|
||||||
`max_spare_servers` int(4) NOT NULL DEFAULT '35',
|
`max_spare_servers` int(4) NOT NULL DEFAULT '3',
|
||||||
`max_requests` int(4) NOT NULL DEFAULT '0',
|
`max_requests` int(4) NOT NULL DEFAULT '0',
|
||||||
`idle_timeout` int(4) NOT NULL DEFAULT '30',
|
`idle_timeout` int(4) NOT NULL DEFAULT '10',
|
||||||
`limit_extensions` varchar(255) NOT NULL default '.php',
|
`limit_extensions` varchar(255) NOT NULL default '.php',
|
||||||
`custom_config` text,
|
`custom_config` text,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
@@ -859,7 +859,7 @@ CREATE TABLE `panel_fpmdaemons` (
|
|||||||
|
|
||||||
|
|
||||||
INSERT INTO `panel_fpmdaemons` (`id`, `description`, `reload_cmd`, `config_dir`) VALUES
|
INSERT INTO `panel_fpmdaemons` (`id`, `description`, `reload_cmd`, `config_dir`) VALUES
|
||||||
(1, 'System default', 'service php7.0-fpm restart', '/etc/php/7.0/fpm/pool.d/');
|
(1, 'System default', 'service php7.3-fpm restart', '/etc/php/7.3/fpm/pool.d/');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -879,13 +879,13 @@ CREATE TABLE `panel_phpconfigs` (
|
|||||||
`fpmsettingid` int(11) NOT NULL DEFAULT '1',
|
`fpmsettingid` int(11) NOT NULL DEFAULT '1',
|
||||||
`pass_authorizationheader` tinyint(1) NOT NULL default '0',
|
`pass_authorizationheader` tinyint(1) NOT NULL default '0',
|
||||||
`override_fpmconfig` tinyint(1) NOT NULL DEFAULT '0',
|
`override_fpmconfig` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
`pm` varchar(15) NOT NULL DEFAULT 'static',
|
`pm` varchar(15) NOT NULL DEFAULT 'dynamic',
|
||||||
`max_children` int(4) NOT NULL DEFAULT '1',
|
`max_children` int(4) NOT NULL DEFAULT '5',
|
||||||
`start_servers` int(4) NOT NULL DEFAULT '20',
|
`start_servers` int(4) NOT NULL DEFAULT '2',
|
||||||
`min_spare_servers` int(4) NOT NULL DEFAULT '5',
|
`min_spare_servers` int(4) NOT NULL DEFAULT '1',
|
||||||
`max_spare_servers` int(4) NOT NULL DEFAULT '35',
|
`max_spare_servers` int(4) NOT NULL DEFAULT '3',
|
||||||
`max_requests` int(4) NOT NULL DEFAULT '0',
|
`max_requests` int(4) NOT NULL DEFAULT '0',
|
||||||
`idle_timeout` int(4) NOT NULL DEFAULT '30',
|
`idle_timeout` int(4) NOT NULL DEFAULT '10',
|
||||||
`limit_extensions` varchar(255) NOT NULL default '.php',
|
`limit_extensions` varchar(255) NOT NULL default '.php',
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
KEY `fpmsettingid` (`fpmsettingid`)
|
KEY `fpmsettingid` (`fpmsettingid`)
|
||||||
@@ -894,8 +894,8 @@ CREATE TABLE `panel_phpconfigs` (
|
|||||||
|
|
||||||
|
|
||||||
INSERT INTO `panel_phpconfigs` (`id`, `description`, `binary`, `file_extensions`, `mod_fcgid_starter`, `mod_fcgid_maxrequests`, `phpsettings`) VALUES
|
INSERT INTO `panel_phpconfigs` (`id`, `description`, `binary`, `file_extensions`, `mod_fcgid_starter`, `mod_fcgid_maxrequests`, `phpsettings`) VALUES
|
||||||
(1, 'Default Config', '/usr/bin/php-cgi', 'php', '-1', '-1', 'allow_call_time_pass_reference = Off\r\nallow_url_fopen = Off\r\nasp_tags = Off\r\ndisable_classes =\r\ndisable_functions = curl_exec,curl_multi_exec,exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system\r\ndisplay_errors = Off\r\ndisplay_startup_errors = Off\r\nenable_dl = Off\r\nerror_reporting = E_ALL & ~E_NOTICE\r\nexpose_php = Off\r\nfile_uploads = On\r\ncgi.force_redirect = 1\r\ngpc_order = "GPC"\r\nhtml_errors = Off\r\nignore_repeated_errors = Off\r\nignore_repeated_source = Off\r\ninclude_path = ".:{PEAR_DIR}"\r\nlog_errors = On\r\nlog_errors_max_len = 1024\r\nmagic_quotes_gpc = Off\r\nmagic_quotes_runtime = Off\r\nmagic_quotes_sybase = Off\r\nmax_execution_time = 30\r\nmax_input_time = 60\r\nmemory_limit = 128M\r\n{OPEN_BASEDIR_C}open_basedir = "{OPEN_BASEDIR}"\r\noutput_buffering = 4096\r\npost_max_size = 16M\r\nprecision = 14\r\nregister_argc_argv = Off\r\nregister_globals = Off\r\nreport_memleaks = On\r\nsendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"\r\nsession.auto_start = 0\r\nsession.bug_compat_42 = 0\r\nsession.bug_compat_warn = 1\r\nsession.cache_expire = 180\r\nsession.cache_limiter = nocache\r\nsession.cookie_domain =\r\nsession.cookie_lifetime = 0\r\nsession.cookie_path = /\r\nsession.entropy_file = /dev/urandom\r\nsession.entropy_length = 16\r\nsession.gc_divisor = 1000\r\nsession.gc_maxlifetime = 1440\r\nsession.gc_probability = 1\r\nsession.name = PHPSESSID\r\nsession.referer_check =\r\nsession.save_handler = files\r\nsession.save_path = "{TMP_DIR}"\r\nsession.serialize_handler = php\r\nsession.use_cookies = 1\r\nsession.use_trans_sid = 0\r\nshort_open_tag = On\r\nsuhosin.mail.protect = 1\r\nsuhosin.simulation = Off\r\ntrack_errors = Off\r\nupload_max_filesize = 32M\r\nupload_tmp_dir = "{TMP_DIR}"\r\nvariables_order = "GPCS"\r\n;mail.add_x_header = On\r\n;mail.log = "/var/log/phpmail.log"\r\nopcache.restrict_api = "{DOCUMENT_ROOT}"\r\n'),
|
(1, 'Default Config', '/usr/bin/php-cgi', 'php', '-1', '-1', 'allow_url_fopen = Off\r\nallow_url_include = Off\r\nauto_append_file =\r\nauto_globals_jit = On\r\nauto_prepend_file =\r\nbcmath.scale = 0\r\ncli_server.color = On\r\ndefault_charset = "UTF-8"\r\ndefault_mimetype = "text/html"\r\ndefault_socket_timeout = 60\r\nasp_tags = Off\r\ndisable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,curl_exec,curl_multi_exec,exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system\r\ndisplay_errors = Off\r\ndisplay_startup_errors = Off\r\ndoc_root =\r\nenable_dl = Off\r\nerror_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE\r\nexpose_php = Off\r\nfile_uploads = On\r\nhtml_errors = On\r\nignore_repeated_errors = Off\r\nignore_repeated_source = Off\r\ninclude_path = ".:{PEAR_DIR}"\r\nimplicit_flush = Off\r\nldap.max_links = -1\r\nlog_errors = On\r\nlog_errors_max_len = 1024\r\nmail.add_x_header = Off\r\nmax_execution_time = 30\r\nmax_file_uploads = 20\r\nmax_input_time = 60\r\nmemory_limit = 128M\r\n{OPEN_BASEDIR_C}open_basedir = "{OPEN_BASEDIR}"\r\noutput_buffering = 4096\r\npost_max_size = 16M\r\nprecision = 14\r\nregister_argc_argv = Off\r\nreport_memleaks = On\r\nrequest_order = "GP"\r\nsendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"\r\nserialize_precision = -1\r\nsession.auto_start = 0\r\nsession.cache_expire = 180\r\nsession.cache_limiter = nocache\r\nsession.cookie_domain =\r\nsession.cookie_httponly =\r\nsession.cookie_lifetime = 0\r\nsession.cookie_path = /\r\nsession.cookie_samesite =\r\nsession.gc_divisor = 1000\r\nsession.gc_maxlifetime = 1440\r\nsession.gc_probability = 0\r\nsession.name = PHPSESSID\r\nsession.referer_check =\r\nsession.save_handler = files\r\nsession.save_path = "{TMP_DIR}"\r\nsession.serialize_handler = php\r\nsession.sid_bits_per_character = 5\r\nsession.sid_length = 26\r\nsession.trans_sid_tags = "a=href,area=href,frame=src,form="\r\nsession.use_cookies = 1\r\nsession.use_only_cookies = 1\r\nsession.use_strict_mode = 0\r\nsession.use_trans_sid = 0\r\nshort_open_tag = On\r\nupload_max_filesize = 32M\r\nupload_tmp_dir = "{TMP_DIR}"\r\nvariables_order = "GPCS"\r\nopcache.restrict_api = "{DOCUMENT_ROOT}"\r\n'),
|
||||||
(2, 'Froxlor Vhost Config', '/usr/bin/php-cgi', 'php', '-1', '-1', 'allow_call_time_pass_reference = Off\r\nallow_url_fopen = On\r\nasp_tags = Off\r\ndisable_classes =\r\ndisable_functions = curl_multi_exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system\r\ndisplay_errors = Off\r\ndisplay_startup_errors = Off\r\nenable_dl = Off\r\nerror_reporting = E_ALL & ~E_NOTICE\r\nexpose_php = Off\r\nfile_uploads = On\r\ncgi.force_redirect = 1\r\ngpc_order = "GPC"\r\nhtml_errors = Off\r\nignore_repeated_errors = Off\r\nignore_repeated_source = Off\r\ninclude_path = ".:{PEAR_DIR}"\r\nlog_errors = On\r\nlog_errors_max_len = 1024\r\nmagic_quotes_gpc = Off\r\nmagic_quotes_runtime = Off\r\nmagic_quotes_sybase = Off\r\nmax_execution_time = 60\r\nmax_input_time = 60\r\nmemory_limit = 128M\r\noutput_buffering = 4096\r\npost_max_size = 16M\r\nprecision = 14\r\nregister_argc_argv = Off\r\nregister_globals = Off\r\nreport_memleaks = On\r\nsendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"\r\nsession.auto_start = 0\r\nsession.bug_compat_42 = 0\r\nsession.bug_compat_warn = 1\r\nsession.cache_expire = 180\r\nsession.cache_limiter = nocache\r\nsession.cookie_domain =\r\nsession.cookie_lifetime = 0\r\nsession.cookie_path = /\r\nsession.entropy_file = /dev/urandom\r\nsession.entropy_length = 16\r\nsession.gc_divisor = 1000\r\nsession.gc_maxlifetime = 1440\r\nsession.gc_probability = 1\r\nsession.name = PHPSESSID\r\nsession.referer_check =\r\nsession.save_handler = files\r\nsession.save_path = "{TMP_DIR}"\r\nsession.serialize_handler = php\r\nsession.use_cookies = 1\r\nsession.use_trans_sid = 0\r\nshort_open_tag = On\r\nsuhosin.mail.protect = 1\r\nsuhosin.simulation = Off\r\ntrack_errors = Off\r\nupload_max_filesize = 32M\r\nupload_tmp_dir = "{TMP_DIR}"\r\nvariables_order = "GPCS"\r\n;mail.add_x_header = On\r\n;mail.log = "/var/log/phpmail.log"\r\nopcache.restrict_api = ""\r\n');
|
(2, 'Froxlor Vhost Config', '/usr/bin/php-cgi', 'php', '-1', '-1', 'allow_url_fopen = On\r\nallow_url_include = Off\r\nauto_append_file =\r\nauto_globals_jit = On\r\nauto_prepend_file =\r\nbcmath.scale = 0\r\ncli_server.color = On\r\ndefault_charset = "UTF-8"\r\ndefault_mimetype = "text/html"\r\ndefault_socket_timeout = 60\r\nasp_tags = Off\r\ndisable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,curl_multi_exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system\r\ndisplay_errors = Off\r\ndisplay_startup_errors = Off\r\ndoc_root =\r\nenable_dl = Off\r\nerror_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE\r\nexpose_php = Off\r\nfile_uploads = On\r\nhtml_errors = On\r\nignore_repeated_errors = Off\r\nignore_repeated_source = Off\r\ninclude_path = ".:{PEAR_DIR}"\r\nimplicit_flush = Off\r\nldap.max_links = -1\r\nlog_errors = On\r\nlog_errors_max_len = 1024\r\nmail.add_x_header = Off\r\nmax_execution_time = 60\r\nmax_file_uploads = 20\r\nmax_input_time = 60\r\nmemory_limit = 128M\r\noutput_buffering = 4096\r\npost_max_size = 16M\r\nprecision = 14\r\nregister_argc_argv = Off\r\nreport_memleaks = On\r\nrequest_order = "GP"\r\nsendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"\r\nserialize_precision = -1\r\nsession.auto_start = 0\r\nsession.cache_expire = 180\r\nsession.cache_limiter = nocache\r\nsession.cookie_domain =\r\nsession.cookie_httponly =\r\nsession.cookie_lifetime = 0\r\nsession.cookie_path = /\r\nsession.cookie_samesite =\r\nsession.gc_divisor = 1000\r\nsession.gc_maxlifetime = 1440\r\nsession.gc_probability = 0\r\nsession.name = PHPSESSID\r\nsession.referer_check =\r\nsession.save_handler = files\r\nsession.save_path = "{TMP_DIR}"\r\nsession.serialize_handler = php\r\nsession.sid_bits_per_character = 5\r\nsession.sid_length = 26\r\nsession.trans_sid_tags = "a=href,area=href,frame=src,form="\r\nsession.use_cookies = 1\r\nsession.use_only_cookies = 1\r\nsession.use_strict_mode = 0\r\nsession.use_trans_sid = 0\r\nshort_open_tag = On\r\nupload_max_filesize = 32M\r\nupload_tmp_dir = "{TMP_DIR}"\r\nvariables_order = "GPCS"\r\nopcache.restrict_api = ""\r\n');
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `cronjobs_run`;
|
DROP TABLE IF EXISTS `cronjobs_run`;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
* optional specify offset for resultset
|
* optional specify offset for resultset
|
||||||
* @param array $sql_orderby
|
* @param array $sql_orderby
|
||||||
* optional array with index = fieldname and value = ASC|DESC to order the resultset by one or more fields
|
* optional array with index = fieldname and value = ASC|DESC to order the resultset by one or more fields
|
||||||
*
|
*
|
||||||
* @access admin
|
* @access admin
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
* @return string json-encoded array count|list
|
* @return string json-encoded array count|list
|
||||||
@@ -135,19 +135,19 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
* @param string $reload_cmd
|
* @param string $reload_cmd
|
||||||
* @param string $config_dir
|
* @param string $config_dir
|
||||||
* @param string $pm
|
* @param string $pm
|
||||||
* optional, process-manager, one of 'static', 'dynamic' or 'ondemand', default 'static'
|
* optional, process-manager, one of 'static', 'dynamic' or 'ondemand', default 'dynamic'
|
||||||
* @param int $max_children
|
* @param int $max_children
|
||||||
* optional, default 0
|
* optional, default 5
|
||||||
* @param int $start_servers
|
* @param int $start_servers
|
||||||
* optional, default 0
|
* optional, default 2
|
||||||
* @param int $min_spare_servers
|
* @param int $min_spare_servers
|
||||||
* optional, default 0
|
* optional, default 1
|
||||||
* @param int $max_spare_servers
|
* @param int $max_spare_servers
|
||||||
* optional, default 0
|
* optional, default 3
|
||||||
* @param int $max_requests
|
* @param int $max_requests
|
||||||
* optional, default 0
|
* optional, default 0
|
||||||
* @param int $idle_timeout
|
* @param int $idle_timeout
|
||||||
* optional, default 0
|
* optional, default 10
|
||||||
* @param string $limit_extensions
|
* @param string $limit_extensions
|
||||||
* optional, limit execution to the following extensions, default '.php'
|
* optional, limit execution to the following extensions, default '.php'
|
||||||
* @param string $custom_config
|
* @param string $custom_config
|
||||||
@@ -167,13 +167,13 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
$config_dir = $this->getParam('config_dir');
|
$config_dir = $this->getParam('config_dir');
|
||||||
|
|
||||||
// parameters
|
// parameters
|
||||||
$pmanager = $this->getParam('pm', true, 'static');
|
$pmanager = $this->getParam('pm', true, 'dynamic');
|
||||||
$max_children = $this->getParam('max_children', true, 0);
|
$max_children = $this->getParam('max_children', true, 5);
|
||||||
$start_servers = $this->getParam('start_servers', true, 0);
|
$start_servers = $this->getParam('start_servers', true, 2);
|
||||||
$min_spare_servers = $this->getParam('min_spare_servers', true, 0);
|
$min_spare_servers = $this->getParam('min_spare_servers', true, 1);
|
||||||
$max_spare_servers = $this->getParam('max_spare_servers', true, 0);
|
$max_spare_servers = $this->getParam('max_spare_servers', true, 3);
|
||||||
$max_requests = $this->getParam('max_requests', true, 0);
|
$max_requests = $this->getParam('max_requests', true, 0);
|
||||||
$idle_timeout = $this->getParam('idle_timeout', true, 0);
|
$idle_timeout = $this->getParam('idle_timeout', true, 10);
|
||||||
$limit_extensions = $this->getParam('limit_extensions', true, '.php');
|
$limit_extensions = $this->getParam('limit_extensions', true, '.php');
|
||||||
$custom_config = $this->getParam('custom_config', true, '');
|
$custom_config = $this->getParam('custom_config', true, '');
|
||||||
|
|
||||||
@@ -251,19 +251,19 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
* @param string $config_dir
|
* @param string $config_dir
|
||||||
* optional
|
* optional
|
||||||
* @param string $pm
|
* @param string $pm
|
||||||
* optional, process-manager, one of 'static', 'dynamic' or 'ondemand', default 'static'
|
* optional, process-manager, one of 'static', 'dynamic' or 'ondemand', default 'dynamic'
|
||||||
* @param int $max_children
|
* @param int $max_children
|
||||||
* optional, default 0
|
* optional, default 5
|
||||||
* @param int $start_servers
|
* @param int $start_servers
|
||||||
* optional, default 0
|
* optional, default 2
|
||||||
* @param int $min_spare_servers
|
* @param int $min_spare_servers
|
||||||
* optional, default 0
|
* optional, default 1
|
||||||
* @param int $max_spare_servers
|
* @param int $max_spare_servers
|
||||||
* optional, default 0
|
* optional, default 3
|
||||||
* @param int $max_requests
|
* @param int $max_requests
|
||||||
* optional, default 0
|
* optional, default 0
|
||||||
* @param int $idle_timeout
|
* @param int $idle_timeout
|
||||||
* optional, default 0
|
* optional, default 10
|
||||||
* @param string $limit_extensions
|
* @param string $limit_extensions
|
||||||
* optional, limit execution to the following extensions, default '.php'
|
* optional, limit execution to the following extensions, default '.php'
|
||||||
* @param string $custom_config
|
* @param string $custom_config
|
||||||
|
|||||||
@@ -32,13 +32,13 @@ return array(
|
|||||||
'label' => $lng['serversettings']['phpfpm_settings']['reload'],
|
'label' => $lng['serversettings']['phpfpm_settings']['reload'],
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'maxlength' => 255,
|
'maxlength' => 255,
|
||||||
'value' => 'service php7.0-fpm restart'
|
'value' => 'service php7.3-fpm restart'
|
||||||
),
|
),
|
||||||
'config_dir' => array(
|
'config_dir' => array(
|
||||||
'label' => $lng['serversettings']['phpfpm_settings']['configdir'],
|
'label' => $lng['serversettings']['phpfpm_settings']['configdir'],
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'maxlength' => 255,
|
'maxlength' => 255,
|
||||||
'value' => '/etc/php/7.0/fpm/pool.d/'
|
'value' => '/etc/php/7.3/fpm/pool.d/'
|
||||||
),
|
),
|
||||||
'pm' => array(
|
'pm' => array(
|
||||||
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
|
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
|
||||||
@@ -49,25 +49,25 @@ return array(
|
|||||||
'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'],
|
'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'],
|
||||||
'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'],
|
'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'],
|
||||||
'type' => 'int',
|
'type' => 'int',
|
||||||
'value' => 1
|
'value' => 5
|
||||||
),
|
),
|
||||||
'start_servers' => array(
|
'start_servers' => array(
|
||||||
'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'],
|
'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'],
|
||||||
'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'],
|
'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'],
|
||||||
'type' => 'int',
|
'type' => 'int',
|
||||||
'value' => 20
|
'value' => 2
|
||||||
),
|
),
|
||||||
'min_spare_servers' => array(
|
'min_spare_servers' => array(
|
||||||
'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'],
|
'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'],
|
||||||
'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'],
|
'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'],
|
||||||
'type' => 'int',
|
'type' => 'int',
|
||||||
'value' => 5
|
'value' => 1
|
||||||
),
|
),
|
||||||
'max_spare_servers' => array(
|
'max_spare_servers' => array(
|
||||||
'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'],
|
'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'],
|
||||||
'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'],
|
'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'],
|
||||||
'type' => 'int',
|
'type' => 'int',
|
||||||
'value' => 35
|
'value' => 3
|
||||||
),
|
),
|
||||||
'max_requests' => array(
|
'max_requests' => array(
|
||||||
'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'],
|
'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'],
|
||||||
@@ -79,7 +79,7 @@ return array(
|
|||||||
'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'],
|
'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'],
|
||||||
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'],
|
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'],
|
||||||
'type' => 'int',
|
'type' => 'int',
|
||||||
'value' => 30
|
'value' => 10
|
||||||
),
|
),
|
||||||
'limit_extensions' => array(
|
'limit_extensions' => array(
|
||||||
'label' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['title'],
|
'label' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['title'],
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ return array(
|
|||||||
'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'],
|
'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'],
|
||||||
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
|
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
|
||||||
'type' => 'int',
|
'type' => 'int',
|
||||||
'value' => 30
|
'value' => 10
|
||||||
),
|
),
|
||||||
'limit_extensions' => array(
|
'limit_extensions' => array(
|
||||||
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||||
|
|||||||
74
templates/misc/php/default.ini.php
Normal file
74
templates/misc/php/default.ini.php
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
<?php
|
||||||
|
$phpini = <<<EOINI
|
||||||
|
allow_url_fopen = Off
|
||||||
|
allow_url_include = Off
|
||||||
|
auto_append_file =
|
||||||
|
auto_globals_jit = On
|
||||||
|
auto_prepend_file =
|
||||||
|
bcmath.scale = 0
|
||||||
|
cli_server.color = On
|
||||||
|
default_charset = "UTF-8"
|
||||||
|
default_mimetype = "text/html"
|
||||||
|
default_socket_timeout = 60
|
||||||
|
asp_tags = Off
|
||||||
|
disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,curl_exec,curl_multi_exec,exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system
|
||||||
|
display_errors = Off
|
||||||
|
display_startup_errors = Off
|
||||||
|
doc_root =
|
||||||
|
enable_dl = Off
|
||||||
|
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE
|
||||||
|
expose_php = Off
|
||||||
|
file_uploads = On
|
||||||
|
html_errors = On
|
||||||
|
ignore_repeated_errors = Off
|
||||||
|
ignore_repeated_source = Off
|
||||||
|
include_path = ".:{PEAR_DIR}"
|
||||||
|
implicit_flush = Off
|
||||||
|
ldap.max_links = -1
|
||||||
|
log_errors = On
|
||||||
|
log_errors_max_len = 1024
|
||||||
|
mail.add_x_header = Off
|
||||||
|
max_execution_time = 30
|
||||||
|
max_file_uploads = 20
|
||||||
|
max_input_time = 60
|
||||||
|
memory_limit = 128M
|
||||||
|
{OPEN_BASEDIR_C}open_basedir = "{OPEN_BASEDIR}"
|
||||||
|
output_buffering = 4096
|
||||||
|
post_max_size = 16M
|
||||||
|
precision = 14
|
||||||
|
register_argc_argv = Off
|
||||||
|
report_memleaks = On
|
||||||
|
request_order = "GP"
|
||||||
|
sendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"
|
||||||
|
serialize_precision = -1
|
||||||
|
session.auto_start = 0
|
||||||
|
session.cache_expire = 180
|
||||||
|
session.cache_limiter = nocache
|
||||||
|
session.cookie_domain =
|
||||||
|
session.cookie_httponly =
|
||||||
|
session.cookie_lifetime = 0
|
||||||
|
session.cookie_path = /
|
||||||
|
session.cookie_samesite =
|
||||||
|
session.gc_divisor = 1000
|
||||||
|
session.gc_maxlifetime = 1440
|
||||||
|
session.gc_probability = 0
|
||||||
|
session.name = PHPSESSID
|
||||||
|
session.referer_check =
|
||||||
|
session.save_handler = files
|
||||||
|
session.save_path = "{TMP_DIR}"
|
||||||
|
session.serialize_handler = php
|
||||||
|
session.sid_bits_per_character = 5
|
||||||
|
session.sid_length = 26
|
||||||
|
session.trans_sid_tags = "a=href,area=href,frame=src,form="
|
||||||
|
session.use_cookies = 1
|
||||||
|
session.use_only_cookies = 1
|
||||||
|
session.use_strict_mode = 0
|
||||||
|
session.use_trans_sid = 0
|
||||||
|
short_open_tag = On
|
||||||
|
upload_max_filesize = 32M
|
||||||
|
upload_tmp_dir = "{TMP_DIR}"
|
||||||
|
variables_order = "GPCS"
|
||||||
|
opcache.restrict_api = "{DOCUMENT_ROOT}"
|
||||||
|
EOINI;
|
||||||
|
|
||||||
|
define('DEFAULT_PHPINI', $phpini);
|
||||||
@@ -27,7 +27,8 @@ class FpmDaemonsTest extends TestCase
|
|||||||
$json_result = FpmDaemons::getLocal($admin_userdata, $data)->add();
|
$json_result = FpmDaemons::getLocal($admin_userdata, $data)->add();
|
||||||
$result = json_decode($json_result, true)['data'];
|
$result = json_decode($json_result, true)['data'];
|
||||||
$this->assertEquals('/etc/php/7.1/fpm/pool.d/', $result['config_dir']);
|
$this->assertEquals('/etc/php/7.1/fpm/pool.d/', $result['config_dir']);
|
||||||
$this->assertEquals(0, $result['max_children']);
|
$this->assertEquals('dynamic', $result['pm']);
|
||||||
|
$this->assertEquals(5, $result['max_children']);
|
||||||
$this->assertEquals('.php', $result['limit_extensions']);
|
$this->assertEquals('.php', $result['limit_extensions']);
|
||||||
self::$id = $result['id'];
|
self::$id = $result['id'];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user