如何解决 HTTP 414“请求 URI 太长"?错误? [英] How do I resolve a HTTP 414 "Request URI too long" error?

查看:60
本文介绍了如何解决 HTTP 414“请求 URI 太长"?错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个 PHP 网络应用程序.我为用户提供了一次更新多个问题的选项.这样做时,有时用户会遇到此错误.有没有办法增加apache中URL的长度?

I have developed a PHP web app. I am giving an option to the user to update multiple issues on one go. In doing so, sometimes the user is encountering this error. Is there any way to increase the lenght of URL in apache?

推荐答案

在Apache下,限制是一个可配置的值,LimitRequestLine.如果您想支持更长的请求 URI,请将此值更改为大于其默认值 8190 的值.该值位于 /etc/apache2/apache2.conf 中.如果没有,请在 AccessFileName .htaccess 下添加一个新行 (LimitRequestLine 10000).

Under Apache, the limit is a configurable value, LimitRequestLine. Change this value to something larger than its default of 8190 if you want to support a longer request URI. The value is in /etc/apache2/apache2.conf. If not, add a new line (LimitRequestLine 10000) under AccessFileName .htaccess.

但是,请注意,如果您确实遇到了此限制,那么您可能是在滥用 GET.您应该使用 POST 来传输此类数据——尤其是因为您甚至承认您正在使用它来更新值.如果您查看上面的链接,您会注意到 Apache 甚至说在正常情况下,不应更改默认值."

However, note that if you're actually running into this limit, you are probably abusing GET to begin with. You should use POST to transmit this sort of data -- especially since you even concede that you're using it to update values. If you check the link above, you'll notice that Apache even says "Under normal conditions, the value should not be changed from the default."

这篇关于如何解决 HTTP 414“请求 URI 太长"?错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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