Project

General

Profile

Bug #14498 » 0001-Add-a-setting-for-PHP-memory-limit-in-System-Advance.patch

Jonathan Lee, 08/04/2023 04:35 PM

View differences:

src/etc/inc/config.inc
154 154
}
155 155
date_default_timezone_set("$timezone");
156 156

  
157
/* override php memory limit */
158
if (isset($config['system']['php_memory_limit']) && !empty($config['system']['php_memory_limit'])) {
159
    ini_set("memory_limit", $config['system']['php_memory_limit'] . "M");
160
}
161

  
157 162
if ($config_parsed == true) {
158 163
	/* process packager manager custom rules */
159 164
	if (is_dir("/usr/local/pkg/parse_config")) {
src/usr/local/pfSense/include/www/system_advanced_misc.inc
70 70
	$pconfig['do_not_send_uniqueid'] = isset($config['system']['do_not_send_uniqueid']);
71 71
	$pconfig['pti'] = get_single_sysctl('vm.pmap.pti');
72 72
	$pconfig['mds']= get_single_sysctl('hw.mds_disable_state');
73
	$pconfig['php_memory_limit'] = $config['system']['php_memory_limit'];
73 74

  
74 75
	$pconfig['powerd_ac_mode'] = "hadp";
75 76
	if (!empty($config['system']['powerd_ac_mode'])) {
......
359 360
			}
360 361
		}
361 362

  
363
		// PHP Memory Limit
364
		if (isset($post['php_memory_limit']) && !empty($post['php_memory_limit'])) {
365
			$config['system']['php_memory_limit'] = $post['php_memory_limit'];
366
		} else {
367
			unset($config['system']['php_memory_limit']);
368
		}
369

  
362 370
		// Add/Remove RAM disk periodic backup cron jobs according to settings and installation type.
363 371
		// Remove the cron jobs on full install if not using RAM disk.
364 372
		// Add the cron jobs on all others if the periodic backup option is set.  Otherwise the cron job is removed.
src/usr/local/www/system_advanced_misc.php
319 319
	'Enabling this checkbox overrides that behavior.');
320 320

  
321 321
$form->add($section);
322

  
323
$section = new Form_Section('PHP Settings');
324

  
325
$group = new Form_Group('Memory Limit');
326

  
327
$group->add(new Form_Input(
328
	'php_memory_limit',
329
	'Memory Limit',
330
	'number',
331
	str_replace("M", "", $pconfig['php_memory_limit']),
332
	['placeholder' => str_replace("M", "", ini_get('memory_limit'))]
333
))->setHelp('PHP memory limit in MiB.');
334

  
335
$section->add($group);
336

  
337
$form->add($section);
338

  
322 339
$section = new Form_Section('RAM Disk Settings (Reboot to Apply Changes)');
323 340

  
324 341
$section->addInput(new Form_Checkbox(
(15-15/16)