PHP - 413请求实体太大

时间:2015-11-26 13:32:35

标签: php android nginx android-json

我一直在尝试创建一个Android应用程序,该应用程序将具有创建新用户配置文件的功能,并将各种详细信息(电子邮件,密码等)存储到远程服务器。现在,我正在使用JSON将用户数据上传到我的远程服务器。但问题是,当我尝试将高分辨率图像上传到我的服务器以获取用户的个人资料图片时,它会给我一个“413 Request Enitity Too Large”错误。现在,我在线阅读这些错误可以通过编辑php.ininginx.conf来修复,但问题是,虽然我设法更改php.ini中的值,但我可以甚至在我的服务器上找到nginx.conf文件!即使我的服务器主机声称其所有服务器上都安装了nginx。在这种情况下我该怎么办?有没有办法用编程方式编辑nginx.conf

这是我得到的输出:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>413 Request Entity Too Large</title>
</head><body>
<h1>Request Entity Too Large</h1>
The requested resource<br />/enter_name.php<br />
does not allow request data with POST requests, or the amount of data provided inthe request exceeds the capacity limit.
</body></html>

对此问题的任何帮助都将受到高度赞赏

1 个答案:

答案 0 :(得分:0)

您可以使用以下命令检查nginx配置:

nginx -t

配置文件位置将在结果中,例如:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

然后在此配置中设置client_max_body_size指令:

client_max_body_size 20m;

有关详细信息,请参阅nginx docs

相关问题