Environment - max input vars: Difference between revisions
m (Add link to Spanish page) |
m (Add environment category) |
||
Line 18: | Line 18: | ||
</code> | </code> | ||
[[Category:Environment|PHP]] | |||
[[es:admin/environment/custom check/max input vars]] | [[es:admin/environment/custom check/max input vars]] |
Revision as of 17:02, 6 May 2021
The PHP setting max_input_vars determines how many input variables may be accepted (limit is applied to $_GET, $_POST and $_COOKIE superglobal separately). If there are more input variables than specified by this directive, an E_WARNING is issued, and further input variables are truncated from the request.
There are a lot of big or potentially big forms in Moodle, such as:
- Site administration tree search
- Editing roles
- Grading courses with big number of participants
- Large quizzes and quiz settings
The default value for max_input_vars in PHP is 1000, this is not enough for many cases.
If you are using PHP 7 the recommended value for the max_input_vars in Moodle is 5000 but you can still use Moodle with the lower value. Moodle code has a workaround that allows to submit the forms even with bigger limit however this workaround is not perfect. It is much better to increase the setting.
If you are using PHP 8 the minimum value of 5000 is required. By default PHP 8 sets to display startup errors (see [[1]]). This means that the warning about exceeding max_input_vars appears before the workaround even applied.
To change max_input_vars you can either set it in php.ini or modify it in runtime, for example for Apache you can create .htaccess file:
php_value max_input_vars 5000