【问题标题】:max_input_vars .htaccess causing 500 errormax_input_vars .htaccess 导致 500 错误
【发布时间】:2013-08-01 20:01:10
【问题描述】:

我有一个大型表单,正在 Wordpress 中更新,插件吐出一个错误,指出 max_input_vars 设置为 1000。该站点位于共享主机上,技术支持已将 php.ini 中的 max_input_vars 更新为 2000 , 我已经验证过了。

我正在尝试将以下内容添加到 .htaccess 以查看这是否有助于解决问题但收到 500 错误,可能是语法错误。

php_value max_input_vars 2000

我是否需要以任何特定格式包含这行代码,我是否遗漏了什么?下面是完整的 .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

目前 max_input_vars 已被注释掉,因此不会导致 500 错误。

任何帮助将不胜感激。

干杯

【问题讨论】:

    标签: php wordpress .htaccess


    【解决方案1】:

    这个对我有用。将此部分添加到 wordpress 文件夹中的 .htaccess 文件中。就是这样。

    <IfModule mod_php5.c>
    
     php_value max_input_vars 5000
    
    </IfModule>
    

    【讨论】:

    • 你需要这样做才能让它在 1&1 共享主机上工作;)
    【解决方案2】:

    您将需要在您的根 wordpress 安装目录中使用 php.ini 文件。 IE。 htaccess 文件在同一个地方。

    我个人添加了所有这 3 行,但在大多数情况下,只有第一行会足够:

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

    【讨论】:

    • 谢谢,我试试看。
    • 论坛插件仍然显示 max_input_vars 限制为 1000 的错误。这已在服务器 php.ini 和 wordpress dir php.ini 上进行了更改
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-23
    • 1970-01-01
    • 2013-06-17
    • 2010-12-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多