HTTP Error: 413 Request Entity Too Large的解决
昨天在使用PHP的CURL调用另一个项目的API:A时,出现了HTTP Error: 413 Request Entity Too Large的错误。而调用另一个API:B则没有这个错误。
A的API没有请求参数。而B有个请求参数。而此类在linux上没有问题,在window上有问题。
首先考虑是否apache配置问题。检查了httpd.conf和php.int,,post_max_size,memory_limit,upload_file_size等,都不可能超过这些上限值。
之后再httpd.conf文件加上
LimitRequestBody 0
LimitRequestLine 0
LimitRequestFieldSize 0
LimitxmlRequestBody 0
ErrorDocument 413 "Sorry,Error Page"
也都无法解决问题。
然后就检查代码,看看两个API的调用有什么区别。区别有2点,返回数据产度不同。有无请求参数。
而提示是显示request entity too large,应该和返回无关。那我就手动修改了请求头的Content-Length:0。第一个无参数的返回正确了。而第二个由于请求头的长度和实际长度不一致(等于没请求参数),导致请求失败。
因此,确定是Content-Length的问题。通过strlen(data);确定后设置Content-Length后,解决此问题。
今天又出现了个错误:
Request-URI too large
The requested URL's length exceeds the capacity limit for the server
因为之前在httpd.conf中设置了LimitRequestLine 0
我以为0是不限制的意思。看来理解错了。删掉改行或者设置为LimitRequestLine 1000000000就OK了。
HTTP Error: 413 Request Entity Too Large的解决的更多相关文章
- 解决Gitlab的The remote end hung up unexpectedly错误,解决RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large问题
解决Gitlab的The remote end hung up unexpectedly错误 解决RPC failed; HTTP 413 curl 22 The requested URL retu ...
- (原)使用TortoiseGit提交代码push的时候报错:HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large
今天我想rk的sdk包里面的一些东西提交到我的git服务器上,结果,总是报错,折腾了一下午,结果才解决. 首先看看我提交代码的时候,报错的信息: git.exe push --progress &qu ...
- 解决RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large问题
使用SourceTree客户端,向远程仓库推送时:RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request ...
- 使用git提交时报错:error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large
Delta compression using up to 4 threads.Compressing objects: 100% (2364/2364), done.Writing objects: ...
- 【Git】error: RPC failed; HTTP 413 curl 22 The requested URL returned error:413 Request Entity Too Large
error: RPC failed; HTTP 413 curl 22 The requested URL returned error:413 Request Entity Too Large fa ...
- Nginx出现“413 Request Entity Too Large”错误解决方法
Nginx出现“413 Request Entity Too Large”错误解决方法 2011-03-25 13:49:55| 分类: 默认分类 | 标签:413 request entit ...
- Nginx 出现413 Request Entity Too Large得解决方法
Nginx 出现413 Request Entity Too Large得解决方法 默认情况下使用nginx反向代理上传超过2MB的文件,会报错413 Request Entity Too Large ...
- Nginx出现413 Request Entity Too Large错误解决方法
Nginx出现的413 Request Entity Too Large错误,这个错误一般在上传文件的时候出现,打开nginx主配置文件nginx.conf,找到http{}段,添加 解决方法就是 打 ...
- Nginx配置,413 Request Entity Too Large错误解决
今天有同事找我,说图片上传之后,不知道去哪里了.分析了一下问题,找到原因之后做了处理,这里简要记录一下. 问题原因: 1.首先后台log并无错误信息: 2.捡查了一下浏览器,发现network中有报错 ...
随机推荐
- Linux中重定向--转载
转:http://blog.csdn.net/songyang516/article/details/6758256 1重定向 1.1 重定向符号 > 输出 ...
- SSH基本管理和配置文件的使用
服务端:linl_S IP:10.0.0.15 客户端:lin_C IP:10.0.0.16 SSHD服务 SSH协议:安全外壳协议.为Secure Shell的缩写.SSH为建立在应 ...
- Android静态变量的生命周期
Android是用Java开发,其静态变量的生命周期遵守Java的设计.我们知道静态变量是在类被load的时候分配内存的,并且存在于方法区.当类 被卸载的时候,静态变量被销毁.在PC机的客户端程序中, ...
- bzoj 3730 震波 (动态点分治)
大意: 给定n节点树, 每个节点有权值, 边权全为1. 给定m个操作: 操作1: (0,x,k) 表示询问到节点x距离不超过k的节点权值和 操作2: (1,x,y) 表示将节点x的权值修改为y 对于所 ...
- JAVA中的>>和>>>号以及<<号的作用
public static void main(String[] args) { //右移2位,输出结果为2.二进制1000右移2位变为0010 System.out.println(8>> ...
- 黑暗世界的搜索引擎 https://fofa.so/ https://www.shodan.io https://www.zoomeye.org 查找设备漏洞
from:http://www.freebuf.com/sectool/121339.html 什么是 Shodan? 首先,Shodan 是一个搜索引擎,但它与 Google 这种搜索网址的搜索引擎 ...
- 加密算法中涉及C/C++总结
学习网站:http://www.runoob.com/cplusplus/cpp-functions.html char在VC(c++)中占1字节(byte),8位(bit). int在VC(c++) ...
- RGB2YCbCr RGB2Gray
Y = 0.2990R+0.5870G+0.1140B; Cb=-0.1687R-0.3313G+0.5000B+128; ...
- hdu3031
题解: 左偏树模板题目 每一次合并,删除最大,修改最大 都是基本操作 代码: #include<cstdio> #include<cmath> #include<algo ...
- SSH使用主机名访问
比如说A电脑已经和B电脑实现了ssh免密码登陆!但是A电脑通过 ssh B电脑的主机名称 不行! 解决办法: 01.修改A电脑中的hosts文件 vim /etc/hosts 02.进入编辑界面 ...