php - 内容长度无效和 HTTP 413 错误?

标签 php linux apache2 cgi mailman

我很忙,因为我的 Linux Apache2 Web 服务器上所有需要填写表单的网站都返回 413 Request Entity Too Large Error 仅在首次填写后(刷新使其工作)。错误看起来像:

Request Entity Too Large

The requested resource
/mailman/subscribe/konrad
does not allow request data with POST requests, or the amount of data provided in the    request exceeds the capacity limit.

Request Entity Too Large

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

这是 apache2 错误日志:

[Tue Dec 04 12:06:27 2012] [error] [client 5.184.118.16] Invalid Content-Length, referer:   http://62.87.177.20/mailman/admindb/konrad
[Tue Dec 04 12:06:27 2012] [error] [client 5.184.118.16] (-3)Unknown error 4294967293:    Error reading request entity data, referer: http://62.87.177.20/mailman/admindb/konrad
[Tue Dec 04 12:07:12 2012] [error] [client 46.134.87.133] Invalid Content-Length, referer: http://www.comfortzg.com/~lekumed2010/login.php?PHPSESSID=e6b9c4d160a2b06435bb8c0676acbe51

它给出了两个脚本(一个使用 PHP 和第二个 Perl (cgi))脚本的错误。我没有使用 SSL。

最佳答案

可能表单是使用GET http方法提交的,但是浏览器构建的url太长了。在这种情况下,通常的服务器响应是 HTTP 错误 413 请求 实体太大。

在这种情况下,您应该使用 POST 方法来解决这个问题。

关于php - 内容长度无效和 HTTP 413 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13702051/

相关文章:

php - 防止直接访问由 ajax 函数调用的文件

regex - grep当前目录下所有.h和.c文件中的关键字但排除两个目录

perl - 从 cpan 安装 Perl CGI 模块时出错

c++ - 自定义 apache2 模块将不会加载错误消息 "Can' t 定位 API 模块结构”

php - search.php 页面的 htaccess 规则

php - 当我使用外部 php 文件执行所有类型的查询时,如何获取 INSERT 查询的最后一个 id?

php - foreach 行插入 foreach

regex - 在带sed的括号前放置逗号

linux - 如何在 shell 中执行 ssh 时更改文件权限

apache2 - 为什么 Ubuntu 16.04 上不存在 apache2 模块 http2?