php - _GET 中 URL 参数的最大大小

标签 php

我正在使用 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> in php.ini

来源:http://www.php.net/manual/en/reserved.variables.get.php#101469

关于php - _GET 中 URL 参数的最大大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7724270/

相关文章:

php - 无法弄清楚如何只在 mysql 中查询最近 30 天的结果

php - 如何使用php webservice查找安装在用户手机中的应用程序版本

php - 需要一个mysql查询来解决 "group by"和 "order by"不返回最新消息

PHP MYSQL 超链接和表单字段

php - Laravel/ Eloquent : hasManyThrough WHERE

php - SQL 或不返回所有行

javascript - 在砖石布局中使用ajax加载网页的初始数据

php - ReflectionException - 中间件类不存在 Laravel 5.5

php - 管理员登录屏幕不适用于 mysql 数据库

php - JQuery $.Get 函数不工作