apache - Ubuntu 16.04 - Apache 2.4.18 - 请求 URI 太长

标签 apache ubuntu zend-framework2 limit request-uri

我正在尝试从 Google 图片搜索结果中保存图片,但是当我在查询字符串参数中发送图片的 src 时,出现以下错误:

Request-URI Too Long 
The requested URL's length exceeds the capacity limit for this server.

Apache/2.4.18 (Ubuntu) Server at 127.0.1.1 Port 80

因为我在我的本地机器上遇到这个错误,所以我可以测试你们所有的想法。

注意:我确实设置了 LimitRequestLineLimitRequestFieldSize100000/etc/apache2/apache2.conf文件。但到目前为止还没有运气。

感谢任何帮助。

最佳答案

请求参数不能无限长。我的猜测是您在将图像 src 作为查询参数发送时达到了最大长度。

来自 this answer here似乎您可以将 LimitRequestLineLimitRequestFieldSize 设置为最大 8192 字节或低于(因此不高于)该值的任何值。

And in Apache, if you use that as a webservers, you can limit it to something below the default 8190 bytes, but not to something above it without changing the source code & recompiling.

另请阅读 this question其中有很多关于 url 最大长度的更多信息:

This is a popular question, and as the original research is ~9 years old I'll try to keep it up to date: As of Nov 2016, the advice still stands. Even though IE11 may possibly accept longer URLs, the ubiquity of older IE installations plus the search engine limitations mean staying under 2000 chars is the best general policy.

换句话说:尽量保持在 2000 个字符以下并使用 POST 发送大量数据......

关于apache - Ubuntu 16.04 - Apache 2.4.18 - 请求 URI 太长,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40759236/

相关文章:

apache - lighttpd:身份验证后如何将端口(仅对本地主机可见)转发到WAN?

php - 在 Windows 10 和 PHP7 上将 ZeroMQ PHP 扩展添加到 XAMPP

php - 如何在 PHP 中重写 URL?

php - Apache 意外关闭

php - ZF2必填字段为空时如何设置消息?

php - 如何为 Zend Cache Storage 设置过期时间?

php - 在 Apigility Resource 中获取当前用户信息

c - 使用 omp 线程的两种相等并行方式之间的实际差异

c - 在哪里可以找到 libvlc 以将其包含在 Ubuntu 上?

node.js - 应该怎么做才能在不使用 sudo 的情况下加入项目的两个模块?