2 # Update options related to memory limits
4 require './phpini-lib.pl';
5 &error_setup($text{'limits_err'});
7 &can_php_config($in{'file'}) || &error($text{'list_ecannot'});
9 &lock_file($in{'file'});
10 $conf = &get_config($in{'file'});
13 $in{"memory_limit_def"} || $in{"memory_limit"} =~ /^(\d+)(k|M|G|b|)$/ ||
14 &error($text{'limits_emem'});
15 &save_directive($conf, "memory_limit",
16 $in{"memory_limit_def"} ? undef : $in{"memory_limit"});
19 $in{"post_max_size_def"} || $in{"post_max_size"} =~ /^(\d+)(k|M|G|b|)$/ ||
20 &error($text{'limits_epost'});
21 &save_directive($conf, "post_max_size",
22 $in{"post_max_size_def"} ? undef : $in{"post_max_size"});
25 $in{"upload_max_filesize_def"} ||
26 $in{"upload_max_filesize"} =~ /^(\d+)(k|M|G|b|)$/ ||
27 &error($text{'limits_eupload'});
28 &save_directive($conf, "upload_max_filesize",
29 $in{"upload_max_filesize_def"} ? undef
30 : $in{"upload_max_filesize"});
33 $in{"max_execution_time_def"} || $in{"max_execution_time"} =~ /^\d+$/ ||
34 &error($text{'limits_emem'});
35 &save_directive($conf, "max_execution_time",
36 $in{"max_execution_time_def"} ? undef : $in{"max_execution_time"});
38 # Save max parsing time
39 $in{"max_input_time_def"} || $in{"max_input_time"} =~ /^\d+$/ ||
40 &error($text{'limits_einput'});
41 &save_directive($conf, "max_input_time",
42 $in{"max_input_time_def"} ? undef : $in{"max_input_time"});
44 &flush_file_lines_as_user($in{'file'});
45 &unlock_file($in{'file'});
46 &graceful_apache_restart();
47 &webmin_log("limits", undef, $in{'file'});
49 &redirect("list_ini.cgi?file=".&urlize($in{'file'}));