413 请求实体太大 - 文件上传问题 [英] 413 Request Entity Too Large - File Upload Issue

查看:36
本文介绍了413 请求实体太大 - 文件上传问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的服务器上上传 30MB 的文件,但无法正常工作.

I am trying to upload 30MB file on my server and its not working.

  1. 当我上传 30MB 文件时,页面加载找不到页面"

当我上传 3MB 文件时,我收到413 Request Entity Too Large"和 nginx/0.6.32

When I upload a 3MB file, I receive "413 Request Entity Too Large" with nginx/0.6.32

我正在尝试查找 nginx 以便我可以增加client_max_body_size",但是我无法在我的服务器上找到安装的 nginx.我什至试过跑步:

I am trying to find nginx so I can increase "client_max_body_size" but I am unable to find nginx installed on my server. I even tried running:

vi /etc/nginx/nginx.conf

vi /usr/local/nginx/conf/nginx.conf

检查配置文件是否存在,但我在我的服务器上找不到它.

to check if the config file exists, but I couldnt find it on my server.

有没有办法解决这个问题?或者我必须在我的服务器上安装 nginx.

Is there anyway to resolve this issue? Or do I have to installed nginx on my server.

我已经在我的 php.ini 文件中进行了所有必要的更改,

I have made all necessary changes in my php.ini files,

post_max_size 128M
upload_max_filesize 100M
memory_limit 256M

谢谢,拉朱

推荐答案

来源:http://www.cyberciti.biz/faq/linux-unix-bsd-nginx-413-request-entity-too-large/

编辑nginx的conf文件:

Edit the conf file of nginx:

nano /etc/nginx/nginx.conf

在http部分添加一行:

Add a line in the http section:

http {
    client_max_body_size 100M;
}

不要用 MB 不行,只能用 M!

Doen't use MB it will not work, only the M!

另外别忘了重启nginx

Also do not forget to restart nginx

systemctl restart nginx

这篇关于413 请求实体太大 - 文件上传问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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