max_input_vars .htaccess causing 500 error

I have a large form that is being updated in WordPress with the plugin spitting out an error saying the max_input_vars is set to 1000. The site is on a shared host and tech support have updated the max_input_vars to 2000 in the php.ini, I have verified this.

I’m trying to add the following to the .htaccess to see if that helps the issue but receive a 500 error, probably bad syntax.

Read More
php_value max_input_vars 2000

Would I need to include this line of code in any particular format, am I missing something? Full .htaccess example below.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

#php_value max_input_vars 2000

Currently the max_input_vars is commented out so it doesn’t cause the 500 error.

Any help would be much appreciated.

Cheers

Related posts

Leave a Reply

2 comments

  1. This one is working for me. Add this section to your .htaccess file in wordpress folder. That’s all.

    <IfModule mod_php5.c>
    
     php_value max_input_vars 5000
    
    </IfModule>
    
  2. You will need to use a php.ini file in your root wordpress instalation directory. I.E. the same place the htaccess file is.

    I personally added all these 3 lines but in most case just the first one will be enpugh:

    max_input_vars = 3000;
    suhosin.post.max_vars = 3000;
    suhosin.request.max_vars = 3000;