weixin_33747129 2015-02-21 05:25 采纳率: 0%
浏览 88

$ _POST大字符串卡住

I send a base64 encoded string using $.post. Its length is 1000000+ (less than 2M)

When I grab it with PHP $_POST it crashes (504 or 424 error returns). Each returns after a big timeout.

Its ok for lower string length < 900000. But for length 900000 the response timeout is 15-30 seconds!!!

To check it I used this code:

javascript:

var string = '...';
console.log(string.lenght); 

$.post("save.php", {
    data: string
}, function(result){
    console.log(result);
});

save.php:

$data = $_POST['data'];
echo strlen($data);

On my local machine everything is ok. Can anyone explain whats happening? Why it takes so long? Why can't I normally send data over 900000 chars?

I also checked server properties:

memory_limit 128M
post_max_size 100M
max_input_vars 10000
upload_max_filesize 100M
  • 写回答

1条回答 默认 最新

  • weixin_33695082 2015-02-21 21:14
    关注

    TwilightSun answered the question. The server has a firewall.

    评论

报告相同问题?