Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

max_input_vars in php.ini not updating after change

Tags:

php

mysql

To keep it clear I'll give as much info as I can to solve this issue.

I tried importing a database today and got the message that my max_input_vars was on 1000 and it needed to be upped in php.ini.

I changed it to many numbers starting from 2000 up to 10000. But everytime I changed it it would not update the max_input_vars and would keep giving me the same error.

I tried restarting the server and looking around the internet but could not find a fix. I hope someone here can help me out with this problem.

like image 324
AquaProgramming Avatar asked Oct 07 '16 07:10

AquaProgramming


People also ask

How do you fix PHP setting max_input_vars must be at least 5000?

If you created your own PHP. ini file, then add the same code inside it: max_input_vars = 5000 Simply change the value to the recommended value. For example, 5000. Save your changes, and reboot your localhost or your server.

What is max_input_vars in PHP ini?

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.

How do I change the maximum vars in PHP?

By default, the maximum number of input variables allowed for PHP scripts is set to 1000. You can change this amount by setting the max_input_vars directive in a php. ini file. To verify the current value of the max_input_vars directive and other directives, you can use the phpinfo() function.


1 Answers

Three things you might have overlooked:

  1. Check phpinfo(); to make sure you're editing the right php.ini file.
  2. If you've never updated that parameter, it's probably commented out like this:

    ; max_input_vars = 1000

    So make sure you remove this sneaky semicolon at the beginning of the line.

  3. Don't forget to restart your web server.
like image 186
Gabriel Labrecque Avatar answered Sep 27 '22 19:09

Gabriel Labrecque