php max_input_vars .htaccess 导致 500 错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17984875/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
max_input_vars .htaccess causing 500 error
提问by Bjorn
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.
我有一个大型表单正在 Wordpress 中更新,插件吐出一个错误,说 max_input_vars 设置为 1000。该站点位于共享主机上,技术支持已将 php.ini 中的 max_input_vars 更新为 2000,我有验证了这一点。
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.
我正在尝试将以下内容添加到 .htaccess 以查看是否有助于解决问题,但收到 500 错误,可能是语法错误。
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.
我是否需要以任何特定格式包含这行代码,我是否遗漏了什么?完整的 .htaccess 示例如下。
# 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.
当前 max_input_vars 被注释掉,所以它不会导致 500 错误。
Any help would be much appreciated.
任何帮助将非常感激。
Cheers
干杯
回答by Taurion
This one is working for me. Add this section to your .htaccess file in wordpress folder. That's all.
这个对我有用。将此部分添加到 wordpress 文件夹中的 .htaccess 文件中。就这样。
<IfModule mod_php5.c>
php_value max_input_vars 5000
</IfModule>
回答by Ovidiu Iacomi
You will need to use a php.ini file in your root wordpress instalation directory. I.E. the same place the htaccess file is.
你需要在你的 wordpress 安装目录中使用一个 php.ini 文件。IE 与 htaccess 文件所在的位置相同。
I personally added all these 3 lines but in most case just the first one will be enpugh:
我个人添加了所有这 3 行,但在大多数情况下,只有第一行是 enpugh:
max_input_vars = 3000;
suhosin.post.max_vars = 3000;
suhosin.request.max_vars = 3000;