Support

Home Forums Pre-Sales max_input_vars error – EE 4.4.8.p PHP 5.3.2

max_input_vars error – EE 4.4.8.p PHP 5.3.2

Posted: January 3, 2015 at 5:22 am

Viewing 10 reply threads


Jonathan

January 3, 2015 at 5:22 am

Now that I have moved from the Decaf version I get the error message which is reproduced below. I am using PHP 5.3.2 and understand that the max_input_vars variable was not introduced until 5.3.9. Is there a way round this?

“The number of inputs on this page has been exceeded. You cannot add anymore items (i.e. tickets, datetimes, custom fields) on this page because of your servers PHP “max_input_vars” setting.”


Jonathan

January 3, 2015 at 7:12 am

I wonder whether I could be so cheeky as to call this a bug?

On my version of PHP there are no limits on this (and max_input_vars is not set at all) so it makes no sense to perform the check.

I seem to have got round it by changing event-espresso-core-reg/core/EE_Config.core.php to contain version_compare( $this->php->version, '5.3.9' instead of version_compare( $this->php->version, '5.3' so that no check is performed – an alternative might have been be to change the return value to display $input_count for information.

It may be, for other people, that max_input_vars *is* set for some versions earlier than 5.3.9 (I don’t know) or there is an equivalent limit (Suhosin patch?) in which case it may make sense to perform some check.

I hope this helps but please do let me know in case this will lead anyone astray!


Lorenzo Orlando Caum

  • Support Staff

January 3, 2015 at 8:23 am

Hi, we don’t recommend modifying the core plugin since any edits will be lost on a software update.

The max input vars warning appears if there are a lot of ticket options in use for an event or a combination of many datetimes & ticket options.

Its a warning to let you know that there could be issues with registration. You can raise the value through an edit in your php.ini file:

https://eventespresso.com/topic/max-input-vars-warning-2/#post-122708

If this isn’t supported by your host, then they’ll be able to raise it for you from their end.

Also, we recommend updating to a current version of PHP.


Lorenzo


Jonathan

January 3, 2015 at 8:40 am

I am happy to make this minor change on each upgrade as it is easier than dealing with constant warnings. I think you should consider making it yourself ๐Ÿ˜‰

Because max_input_vars is not set at all, the warning is coming up when $input_count is only 256 or so.

I have tested my system with a simple form and it can handle 10,000 inputs so effectively there is no limit.

I am not sure it is possible to set max_input_vars for PHP < 5.3.9 as that was only introduced in PHP 5.3.9. Further information is here: http://www.phpclasses.org/blog/post/171-PHP-Vulnerability-May-Halt-Millions-of-Servers.html

I have contacted my hosting company about max_input_vars (because I may well be wrong) and upgrading PHP, but note that your requirements page states PHP 5.3+

Event Espresso 4 is excellent software by the way, and I am more than happy with it.


Lorenzo Orlando Caum

  • Support Staff

January 3, 2015 at 8:57 am

Hi Jonathan, you are correct on the version of PHP that it was introduced in:

http://cl.ly/image/2C2M271k0u0q

We introduced this warning with the initial release of Event Espresso 4.4 last year. I’ve updated the requirements page to PHP 5.3.9 and we appreciate your kind words.


Lorenzo


Jonathan

January 3, 2015 at 9:06 am

You are welcome, and the quick answers on the forum are invaluable also.

I think it would make more sense to keep the requirements the same but just don’t perform the check unless the PHP version is 5.3.9+. My reasoning is that in earlier PHP versions there was NO limit and therefore a high $input_count simply wouldn’t cause a problem. It only would cause a problem in those PHP versions where max_input_vars DOES exist. (In earlier versions perhaps you should check against the relevant Suhosin patch variables, if set.) I’ll continue to use EE4, though do hope to upgrade PHP in any event.


Tony

  • Support Staff

January 5, 2015 at 6:07 am

Hi Jonathan,

I have created a ticket to update the check to 5.3.9, I can’t see any reason not to do this for the reasons mentioned above but the developers may know something we don’t ๐Ÿ™‚

However just to note whilst I do agree with everything you have posted, PHP 5.3.x is now end of life, it is much better to upgrade the version of PHP to either 5.3.29 (although I don’t recommended it due to being eol) or to the latest version of 5.4 (currently 5.4.36), I know you have contacted your host with a view to doing so, I just wanted to note this for future readers too.

Also when updating PHP above 5.3.8 you’ll need to also increase max_input_vars to a value higher than default (1000), how much higher depends on your events, registration form, tickets, datetimes etc. With a default install of EE4 I get around 37 tickets and a single datetime with a limit of 1000.

It is expected that most users will not actually hit the limit for most events (conferences or events with high ticket selections are usually the types of events that do)


Tony

  • Support Staff

January 5, 2015 at 7:13 am

Just a quick update, the reason for checking for ‘5.3’ is when hosts run custom versions such 5.3.21-specialfeature

This would cause issues with version_compare(), however the developers now have another method to check the version number so we are testing this currently.


Tony

  • Support Staff

January 6, 2015 at 6:02 am

Hi Jonathan,

I have tested the new fix, and so far it seems to be working well.

As this is not a major fix and is very specific to the max_input_vars notice I will post the code change here in-case you would like to use it.

Same file – event-espresso-core-reg/core/EE_Config.core.php

Change this:

if ( ( $input_count >= $this->php->max_input_vars ) && version_compare( $this->php->version, '5.3', '>=' ) ) {

To this:

if ( ( $input_count >= $this->php->max_input_vars ) && ( PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 3 && PHP_RELEASE_VERSION >=9 ) ) {

Note that this change is still in testing, but as mentioned, it’s rather specific.

This will be included within the next version of Event Espresso.


Jonathan

January 8, 2015 at 12:38 pm

That’s great, thank you.


Josh

  • Support Staff

January 27, 2015 at 3:02 pm

Hi there,
This is fixed in Event Espresso 4.4.9.p, available now.

Viewing 10 reply threads

The support post ‘max_input_vars error – EE 4.4.8.p PHP 5.3.2’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso