vendredi 10 juin 2016

PHP/Apache/AJAX - POST limit?


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)


Aucun commentaire:

Enregistrer un commentaire