|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64584 Content-length is correct, but data truncated in php://input
Submitted: 2013-04-04 17:12 UTC Modified: 2013-04-05 01:17 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: viraj dot kanwade at snstech dot com Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 5.3.23 OS: Centos
Private report: No CVE-ID: None
 [2013-04-04 17:12 UTC] viraj dot kanwade at snstech dot com
We use PHP 5.3.14

Sometimes ajax post to a PHP page, results in $_SERVER content-length to be set 
correctly, but the $_POST does not have all data. I have also tested php://input 
to see if the data was received. But the data was truncated. This is NOT a file 

The data could be of 1000-5000 chars. But only 400-600 chars are received.

This is intermittent.

Could be similar to

Expected result:
The post values submitted by ajax request should be available in $_POST.

Actual result:
The post value is truncated.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-04-05 01:17 UTC]
-Status: Open +Status: Not a bug
 [2013-04-05 01:17 UTC]
$_SERVER['Content-Length'] is set by the web server and tends to come directly 
from the Content-Length header the client sends. If the client aborts before 
sending all the data the web server is not going to adjust this value. This is 
quite normal. You can check the connection status to see if the client aborted 
mid-request on you. See
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jun 13 18:01:35 2024 UTC