1

I would like to send very long string (about 1 200 000 chars) from my jQuery script to PHP server. I created code:

$.ajax({
    url : 'con.php',
    async : false,
    type : 'POST',
    data : 'require='+parameters
}).done(function(result) {
    console.log(result);
});

where parameters is describing string and in PHP:

if ($_POST['require']){
echo 'ok';
}

When I'm sending normal-size string everything is good, but when I sent my big string I got the error message:

Notice: Undefined index: require

I setup memory_limit in my php.ini to 500M and still get nothing.

I tried to use [suhosin][1] with setting up suhosin.memory_limit greater than 0 with same results as above.

How can I resolve my problem?

Abela
  • 1,225
  • 3
  • 19
  • 42
Krystian
  • 458
  • 1
  • 9
  • 26

1 Answers1

1

Try having your data sent like this:

data: {
    require: parameters
}

and set your php max post sizes:

post_max_size=20M
upload_max_filesize=20M
Ozzy
  • 10,285
  • 26
  • 94
  • 138