我正在使用 REST 访问 PHP 服务器:所有数据都作为 URL 参数在 GET 请求中传递。其中一个参数在 query_string 中到达服务器,但它不在 _GET 全局中。但缩短参数(截止似乎是 512 个字符左右)让它通过。
假设我已经正确诊断出问题,有没有办法改变这个最大尺寸?我在文档中没有找到任何解释,甚至没有提到这个限制。这是在 Debian 挤压/Apache 2.2.16/PHP 5.3.3 上。
最佳答案
好吧,似乎某些版本的 PHP 对 GET 参数的长度有限制:
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.
To add support for long parameters with suhosin, add
suhosin.get.max_value_length = <limit>
inphp.ini
来源:http://www.php.net/manual/en/reserved.variables.get.php#101469
关于php - _GET 中 URL 参数的最大大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7724270/