Is there any way to increase the PHP max_input_vars limit for only one PHP page. I'm using a CSV upload and extract function. In which the csv data will be saved to the db using Insert query. But when i tried with larger CSV data such as about 9000 entries i got an error like this:
PHP Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini.
I know we need to change the limit value in php.ini or .htaccess but i don't want to change the limit for the entire project for maintaing the security. So Is there any way to change it only for this functionality ??
There's no way of doing that. You have to change it in the php.ini
file, because not even ini_set
can change it.
max_input_vars
has a changeable mode ofPHP_INI_PERDIR
meaning it can't be changed usingini_set
(only in php.ini, .htaccess or httpd.conf)
(Source)
You can, however, temporarily change that setting by adding this line to your .htaccess
:
php_value max_input_vars 3000
(Source)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With