Can't modify max_input_vars in PHP
P粉176980522
P粉176980522 2023-11-10 11:49:31
0
1
909

I need to increase max_input_vars value in php for Moodle installation. However, when I change the value in the php.ini file, the moodle web installer still prompts:

PHP setting max_input_vars must be at least 5000.

phpinfo() displays:

max_input_vars => 5000 => 5000

Editing the .htaccess file has no effect.

P粉176980522
P粉176980522

reply all(1)
P粉354948724

Create a temporary php file in the Moodle directory with the following content and run it through the browser (running php through the command line uses a different php ini file instead of the apache file)


This will confirm which php ini file is being used, for example /etc/php/xx/apache2/php.ini

Also search the page for max_input_vars to see the value.

Master is the value in php.ini - if it is not 5000, you have edited the wrong php ini file, or you need to restart apache

Local is the value being used - if it is different from the main value, it is overridden by apache

In this case, check the .htaccess and conf files in the apache directory, for example etc/apache2/

If the local value is correct - 5000 - then it has been changed by code somewhere in the Moodle directory. Maybe check config.php or search for max_input_vars

in your code
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template