PHP post数据是空的大文件已经设置了所有需要的ini值仍然不能工作


PHP post Data is empty for large files had set all required ini values still not working

我试图通过文件上传上传一个12gb的文件,但帖子数据是空的

它适用于8GB的文件,但不适合大于8GB的文件

我的php.ini值是

max_execution_time 30000000000
max_input_time 60000000000
memory_limit 6G
post_max_size 800G
upload_max_filesize 200G

请帮忙!提前感谢

set max_execution_time to(0) 0。0表示脚本可以永远运行。接下来设置max_input_time为(-1)。这指定-1是无限的,因为任何脚本都不能以负时间执行。

例子
max_execution_time = 0
max_input_time = -1

必须设置memory_limit的值大于post_max_size upload_max_filesize 。在您的情况下,设置如下值。

memory_limit = 20G
post_max_size = 15G
upload_max_filesize = 15G

然后重启apache服务器或者重启所有服务

如果upload_max_filesize大于post_max_size,则必须增大post_max_size,使其大于upload_max_size。

如果post_max_size大于memory_limit,则必须增加> memory_limit使其大于post_max_size。

因此尽量增加memory_limit或降低post_max_size

这篇文章详细解释

编辑

我今天遇到了一个类似的问题:当我尝试上传大文件时,没有响应返回。错误日志显示如下:

[Wed Nov 02 07:45:28.428652 2016] [fcgid:warn] [pid 15602] [client . cn213.24.127.118:22388] mod_fcgid: HTTP请求长度139264 (so far)超过MaxRequestLen (131072), referer: https://domain.com/path

vhosts文件中的FcgidMaxRequestLen设置为适合您的值即可解决此问题。