max_input_vars and ACF

2019-06-06 10:23发布

问题:

for a client I have to fix a problem. At the moment he can’t save more than 66 fields in an ACF-Group. I was researching a bit and found out, that one possible problem could be, that the max_input_vars in the php.ini is too low, so PHP rejects the POST-Values after 1.000 fields. I was checking and indeed the Form was sending more than 1.000 fields.

I first tried the .htaccess-Solution as described e.g. here:

http://support.advancedcustomfields.com/forums/topic/repeater-field-values-disappearing/

But, this produced an Error 500 because the machine is (as I found out) running as FastCGI. For people with this problem, check the possibilty of the user.ini:

http://php.net/manual/de/configuration.file.per-user.php

So I translated the .htaccess to the .user.ini and uploaded this file.

max_input_vars = 5000

max_input_time = 300

max_input_nesting_level = 128

max_execution_time = 300

post_max_size = 32M

<?php phpinfo(); ?> displays set the new values are set as local values for PHP now.

But unfortunatly still, after uploading and everything, I am not able to save more than these 66 fields. Now, I have no further idea, what to do. Does anyone has an suggesstion?

Thanks a lot!

回答1:

I had the same problem and it turned out that because the server was using the Suhosin patch I also needed to set the following my .htaccess file:

suhosin.post.max_vars = 20000
suhosin.request.max_vars = 20000