如果POST数据超过几百个字符,则从jQuery到PHP的POST请求会停止

I have a plain ajax request being initiated by jQuery to a PHP script:

$.ajax({
  url:"script.php",
  data: data,
  type: "POST"
  // error & success handlers here
});

If the data (could be JSON, could be a binary file), exceed a few hundred characters in length, the POST request never completes, it just hangs there. No errors in apache log or JS console, no other indication as to what might be going on.

Fiddling with php.ini post_max_data and other settings did not yield any results and all settings I could think of are set to very permissive values.

I'm running an Ubuntu 14.04 server with Apache 2.4 and PHP 5.5.9.

What am I missing?

The post_max_data config parameter is probably the issue.

Add (or replace) the following in php.ini

upload_max_filesize = 256M
post_max_size = 256M

Also try this in your .htaccess

php_value upload_max_filesize 256M
php_value post_max_size 256M

Note that some server hosts might not allow to add these to .htaccess, but it looks like that might not be an issue for you.