I'm trying to send POST data that is 2 million characters big (non-binary string) via ajax (jQuery) and it always comes up as blank on the PHP side. Here is my code:
var string = "<data string that is 2M chars long>";
$.ajax({
cache: false,
type: 'POST',
url: 'data.php',
data: {'data_string': string}
});
On the PHP side, I get the following error message (when trying to retrieve data from $_POST['data_string']
):
Notice: Undefined index: data_string in data.php on line ...
I've checked the post_max_size
in php.ini, and it's set at 256M which should be more than enough? I'm stumped and not sure what I'm doing wrong...
EDIT: If I make "string"
a small amount of data (e.g. var string = 'test'
) then $_POST["data_string"]
returns test
, as expected. So I'm wondering if there's some sort of data limit I'm reaching in Apache2, PHP or the browser itself? I'm using Google Chrome 17.0.963.79
EDIT2: memory_limit = 256M
in php.ini
EDIT3: max_input_time = -1
in php.ini
EDIT4: var_dump($_POST) returns Array(0)
EDIT5: running the latest stable version of PHP5 on debian squeeze: PHP 5.3.3-7+squeeze8 with Suhosin-Patch (cli) (built: Feb 10 2012 14:12:26)
You'll have to check the limits parameters on all items between you and the server. Quite hard for proxy servers if any, but at least you can check:
Apache:
PHP:
If you have reached the compiled in limit for Apache your only solution is to avoid direct POSt of such a big chunk of data, you'll have to break it into pieces.
You may also check the suhosin.ini settings, eg.:
suhosin.post.max_value_length = 65000
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With