远程服务器在ubuntu中为apache2返回了400个错误请求

时间:2016-07-19 08:26:34

标签: php apache ubuntu docker

我正在WPF中将文件上传到我的服务器。我没有显示此代码,因为它适用于我的localhost,所以看起来我的服务器配置很糟糕。 我的请求到达这个PHP脚本:

upload.php的:     

Error code: BadRequest
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
<hr>
<address>Apache/2.4.7 (Ubuntu) Server at 192.168.99.1 Port 8080</address>
</body></html>
The uploaded file was only partially uploaded

它正在工作,当我的文件小于2KB时,非常奇怪......所有更大的内容都会立即被拒绝并出现错误响应:

{{1}}

那么我的错误可能是哪里?当文件在远程服务器上大于2 KB但不是localhost时,为什么我的请求无效?我在Docker中使用Apache2 / PHP5和Ubuntu 14.04,我的php.ini:

post_max_size = 1024M; upload_max_filesize = 1024M; memory_limit = 512M;

1 个答案:

答案 0 :(得分:0)

你还可以尝试在php中设置内存限制吗?在php.ini

 memory_limit = 32M