如何更改 PHP 中 POST 变量的最大数量? [英] How to change maximum number of POST variable in PHP?

查看:101
本文介绍了如何更改 PHP 中 POST 变量的最大数量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地机器上使用 WAMP,当提交具有 2000 个输入字段的 FORM(method="POST") 时,我只能读取 1001 _POST 变量.即使用 Netbeans 调试器,如果表单中的输入字段超过 1001 个,我可以清楚地看到 _POST 大小始终为 1001.

I'm using WAMP in my local machine, when a FORM(method="POST") with 2000 input fields is submitted I'm able to read only 1001 _POST variable. i.e With Netbeans debugger I can clearly see _POST size is always 1001 if there are more than 1001 input fields in the form.

在另一台机器(WAMP)上同样工作正常,在那里我可以看到所有的 POST 变量.

The same is working fine in another machine(WAMP), where I can see all the POST variables.

请帮我解决我的问题.

推荐答案

PHP 5.3.9 引入了 max_input_vars 配置选项,默认值为 1000.查看 运行时配置 部分.默认值和更改日志位于页面顶部.

PHP 5.3.9 introduced the max_input_vars config option, which is defaulted to a value of 1000. Check out the Runtime Configuration section of the PHP manual. The default value and the change log are at the top of the page.

可以通过更新服务器的 php.ini、添加 .htaccess 文件或 在 httpd.conf 中添加一行.

The value can be changed by updating the server's php.ini, adding an .htaccess file, or adding a line to httpd.conf.

这篇关于如何更改 PHP 中 POST 变量的最大数量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆