admin/environment/custom check/max input vars

De MoodleDocs
Revisión del 22:20 30 abr 2021 de German Valero (discusión | contribs.) (copied from English page)
(difs.) ← Revisión anterior | Revisión actual (difs.) | Revisión siguiente → (difs.)

Nota: Urgente de Traducir. ¡ Anímese a traducir esta muy importante página !.     ( y otras páginas muy importantes que urge traducir)

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