POST内容长度超出限制 [英] POST Content-Length exceeds the limit

查看:112
本文介绍了POST内容长度超出限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户上传文件时,我在php的error_log中也收到类似的错误

I get similar errors in my error_log in php when users are uploading their files

PHP警告:POST内容长度的11933650字节超出了第0行中Unknown中的8388608字节的限制

PHP Warning: POST Content-Length of 11933650 bytes exceeds the limit of 8388608 bytes in Unknown on line 0

在我的php.ini(在public_html中创建自定义ini文件)中是否可以解决此问题,我必须将其设置为1GB左右多少?我将在php.ini中将其设置更改为该设置,是否可以解决问题?

In my php.ini (created custom ini file in public_html) would this solve this problem, how much would I have to set it to around 1GB? I am going to change my settings to this in php.ini, will it solve the problem?

upload_max_filesize = 1000M ;1GB
post_max_size = 1000M

我将"memory_limit"限制设置为什么.

What would I set the 'memory_limit' limit to.

这在我的脚本中检查上传的文件大小是否为< 1GB

Also would this be correct in my script to check file uploaded size is <1GB

if($_FILES["uploadedfile"]["size"]<1000000)

推荐答案

8388608字节为8M,这是PHP中的默认限制.对php.ini所做的更改确实可以解决问题(确保在完成更改后重新启动Apache服务器).

8388608 bytes is 8M, the default limit in PHP. Those changes to php.ini should indeed solve the problem (make sure your restart your Apache server after making them).

这里不需要更改内存限制.

Memory limit shouldn't need to be changed here.

这篇关于POST内容长度超出限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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