Home  >  Q&A  >  body text

Can't modify max_input_vars in PHP

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粉176980522P粉176980522318 days ago745

reply all(1)I'll reply

  • P粉354948724

    P粉3549487242023-11-11 09:24:17

    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

    reply
    0
  • Cancelreply