1

I got a little problem regarding the submit of multiple forms:

I'm trying to submit a bigger number of $_POST-variables, however, my server-side script ends (or just breaks down) after, in total 271 form variables, are submitted.

Trying on localhost, everything works just fine, without any issues. Here, in total 771 post variables are submitted.

I've also done a little research so far, trying to figure what kind of variables I could possibly change in order to configure a bigger data range or something similar.

So here's my server configuration:

max_execution_time  30  30
max_input_nesting_level 64  64
max_input_time  60  60
max_input_vars  1000    1000
memory_limit    256M    256M
post_max_size   8M  8M

localhost configuration:

max_execution_time  30  30
max_file_uploads    20  20
max_input_nesting_level 64  64
max_input_time  60  60
max_input_vars  1000    1000
memory_limit    256M    256M
post_max_size   8M  8M

As you can see, it's the same configuration... I also have the suhosin - extension installed on my server, default configuration. I'm not that familiar with this extension, but using default values should have that impact (i guess :))

Server-PHP Version: 5.3.9
Local: 5.3.17

The problem is quite similar to this one.

I'm trying to solve the problem for weeks now, if you have any kind of ideas.. it would just be great ;)

thanks :)

UPDATE:

if i'm using this approach (thanks):

$pairs = explode("&", file_get_contents("php://input"));
$vars = array();
foreach ($pairs as $pair) {
    $nv = explode("=", $pair);
    $name = urldecode($nv[0]);
    $value = urldecode($nv[1]);
    $vars[$name] = $value;
}
print_r($vars);

i see all form variables and content that i'm displaying before. However, accessing the $_POST variables directly by using

isset($_POST['LanguageContentForm']

and saving that to a variable doesn't work.. :/

Community
  • 1
  • 1
runFatTony
  • 23
  • 4
  • 2
    With `localhost` the `POST` request will transfer quicker so it might not be hitting the the _max_execution_time_. If you lower the _max_execution_time_ on `localhost` to something very small can you reproduce the problem locally? Similarly if you increase the value on the remote server does the problem still remain? – andyb Mar 28 '13 at 09:21
  • could this help? http://stackoverflow.com/questions/5077969/php-some-post-values-missing-but-are-present-in-php-input – Natrium Mar 28 '13 at 09:21
  • Can you check apache log file and is there any errors logged? – Amit Mar 28 '13 at 09:21
  • This could affect you: http://www.phpclasses.org/blog/post/175-Another-Serious-Security-Bug-on-PHP-539.html Can't yout just update the server PHP version? – madflow Mar 28 '13 at 09:23
  • 1
    @andyb reducing the value of max_execution_time didn't had any effect... :/ – runFatTony Mar 28 '13 at 09:41
  • If you have that many variables to post, could you perhaps enter your data in a csv file, upload it to the server, and then process it from the csv file? It'd probably be faster than processing a huge form. – starshine531 Mar 28 '13 at 09:55
  • @starshine531 it is a form to translate languages, also splitted into multiple files... – runFatTony Mar 28 '13 at 10:05

1 Answers1

0

If you check phpinfo() you can see a var for suhosin.post.max_vars on each machine.

You should be able to change it in .htaccess with something like this:

php_value suhosin.post.max_vars 1000
php_value suhosin.request.max_vars 1000

Update

Maybe this one too:

suhosin.request.max_varname_length

Type: Integer
Default: 64

Defines the maximum name length (excluding possible array indicies) of variables that may be registered through the COOKIE, the URL or through a POST request. This setting is also an upper limit for the variable origin specific configuration directives.

AbsoluteƵERØ
  • 7,816
  • 2
  • 24
  • 35