gpt4 book ai didi

php - 413 请求实体太大 - 文件上传问题

转载 作者:IT老高 更新时间:2023-10-28 12:06:10 25 4
gpt4 key购买 nike

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

  1. 当我上传 30MB 文件时,页面加载“Page Not Found

  2. 当我上传 3MB 文件时,我收到“413 Request Entity Too Large” nginx/0.6.32

我正在尝试查找 nginx,以便增加“client_max_body_size”,但我无法在我的服务器上找到安装的 nginx。我什至尝试过运行:

vi /etc/nginx/nginx.conf

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

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

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

编辑:

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

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文件:

nano /etc/nginx/nginx.conf

httpserverlocation 部分添加一行:

client_max_body_size 100M;

不要用MB不行,只有M!

另外别忘了重启nginx

systemctl restart nginx

关于php - 413 请求实体太大 - 文件上传问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24306335/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com