Stack Matrix Hub (10)
max_input_vars & post_max_size Tuning for Moodle Gradebook
Prevent silent gradebook truncation and large assignment upload failures by sizing max_input_vars=5000 and post_max_size in PHP-FPM.
max_input_vars=5000 · post_max_size=128M · max_execution_time=120
Why Moodle 4.x Fails Moodle Environment Checks at 1,000 Input Vars
PHP ships with max_input_vars = 1000 by default. In a Moodle course with 150 students and 12 graded quiz items, saving the Single View or Grader Report submits over 1,800 form fields—causing PHP to silently drop trailing student grades.
Setting Safe Pool-Level Limits Without Enabling DoS Hash Collisions
Moodle 4.x explicitly recommends max_input_vars = 5000 in php-fpm.conf. Pair it with upload_max_filesize = 128M, post_max_size = 136M, and nginx client_max_body_size 140M so large SCORM or video submissions match end-to-end.
Measured Thresholds & Configuration
| PHP Directive | PHP Default | Moodle 4.x Exam Baseline | Failure Symptom if Default |
|---|---|---|---|
| max_input_vars | 1000 | 5000 | Grader report drops student rows |
| upload_max_filesize | 2M | 128M | SCORM / MBZ upload rejected |
| post_max_size | 8M | 136M | Blank POST on assignment submit |