Take the tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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.. :/

share|improve this question
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 at 9:21
 
could this help? stackoverflow.com/questions/5077969/… –  Natrium Mar 28 at 9:21
 
Can you check apache log file and is there any errors logged? –  Amit Mar 28 at 9:21
 
This could affect you: phpclasses.org/blog/post/… Can't yout just update the server PHP version? –  madflow Mar 28 at 9:23
1  
@andyb reducing the value of max_execution_time didn't had any effect... :/ –  runFatTony Mar 28 at 9:41
show 2 more comments

1 Answer

up vote 0 down vote accepted

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.

share|improve this answer
 
on the remote machine, it is set to a value of 800.. shouldn't that be enough? –  runFatTony Mar 28 at 9:38
 
There are a lot of different flags for suhosin. If you're passing arrays instead of straight vars there are limits on those too... here's a good reference: hardened-php.net/suhosin/configuration.html –  AbsoluteƵERØ Mar 28 at 9:44
 
This one is set to 256 on the server configuration –  runFatTony Mar 28 at 10:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.