_GET中的URL参数的最大大小 [英] Max size of URL parameters in _GET
问题描述
我正在使用REST访问PHP服务器:所有数据都作为URL参数在GET请求中传递.参数之一以query_string到达服务器,但不在_GET全局变量中.但是缩短参数(截止值似乎是512个字符左右)就可以了.
I am accessing a PHP server using REST: all data is passed in a GET request as URL parameters. One of the parameters arrives at the server in the query_string, but it is not in the _GET global. But shortening the parameter (the cutoff seems to be around 512 characters) lets it through.
假设我已正确诊断问题,是否可以更改此最大大小?我在文档中没有找到任何解释,甚至没有提及此限制.这是在Debian挤压/Apache 2.2.16/PHP 5.3.3上.
Assuming I have diagnosed the problem correctly, is there a way to change this maximum size? I have not found any explanation in the documentation, not even a mention of this limit. This is on Debian squeeze / Apache 2.2.16 / PHP 5.3.3.
推荐答案
好的,似乎某些版本的PHP对GET参数的长度有所限制:
Ok, it seems that some versions of PHP have a limitation of length of GET params:
请注意,安装了suhosin补丁程序的PHP安装程序将具有 get参数的默认限制为512个字符.虽然不好 实际上,大多数浏览器(包括IE)都支持多达2000个左右的URL 字符,而Apache的默认值是8000.
Please note that PHP setups with the suhosin patch installed will have a default limit of 512 characters for get parameters. Although bad practice, most browsers (including IE) supports URLs up to around 2000 characters, while Apache has a default of 8000.
要使用suhosin添加对长参数的支持,请添加
php.ini
To add support for long parameters with suhosin, add
suhosin.get.max_value_length = <limit>
in php.ini
来源: http://www.php.net/manual/zh-CN/reserved.variables.get.php#101469
这篇关于_GET中的URL参数的最大大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!