Support

Home Forums Event Espresso Premium max_input_vars not updating

max_input_vars not updating

Posted: November 11, 2015 at 4:24 pm


Emily

November 11, 2015 at 4:24 pm

Hello,

I’m using EE4 and am unable to add an event to my page due to the max_input_vars being exceeded. I’ve changed the php.ini on the server to 3000, however the settings in EE are still recording this as 1000. The PHP version is 5.4.43

I’ve read other support threads that suggest this can be fixed by adding php.ini into the subfolder, adding a line of code to the .htaccess file and restarting Apache.

My host has told me this isn’t possible as I’m on a shared server.

Do you know any other way I can resolve this?

Thanks for your time,
Emily


Tony

  • Support Staff

November 11, 2015 at 4:43 pm

Hi Emily,

max_input_vars is a setting on the server, so it needs to be upped on the server itself.

Event Espresso basically just reads php info from within the plugins directory, so if your server returns 1000 for max_input_vars there that is why EE displays it.

I’ve changed the php.ini on the server to 3000, however the settings in EE are still recording this as 1000. The PHP version is 5.4.43

Was this within the root directory of your site?

The options you mentioned above are all of the solutions for settings this up, you should only need one of those options or your host should be able to set this for your site specifically. This is standard on most shared hosting packages so if your host doesn’t support this I would question why.

I’m not intended to be negative towards your host, but just because you are using a shared hosting package should not prevent you from altering this setting.

It sounds like the root directory is using your custom php.ini file but any sub directories are using the global values, your host should be able to fix this so that the value from your custom php.ini applies recursively.


Emily

November 11, 2015 at 6:00 pm

Hi Tony,

That’s what I thought! Honestly they are the most unhelpful hosting service I’ve ever come across. We will definitely be moving the website, however we are a volunteer association so need to go through the committee etc before changing. Unfortunately I won’t be able to do this before the event.

The php.ini file I updated is in the public_html directory of the website.

I asked them to do precisely what you’ve said and they told me I have to upgrade to a VPS package.

Are you able to provide any advice for how I can apply it recursively myself? I do have access to the .htaccess file.

Thanks for your help,
Emily


Josh

  • Support Staff

November 11, 2015 at 6:25 pm

Hi Emily,

One of the hosts I’m familiar with, A2, wrote up a guide on how:

https://www.a2hosting.com/kb/developer-corner/php/using-php-directives-in-custom-htaccess-files/setting-the-max-input-vars-directive-in-an-htaccess-file


Emily

November 11, 2015 at 6:31 pm

Thanks for that Josh – I’ll take a look at that.


Emily

November 11, 2015 at 10:17 pm

OK quick update…. I updated the htaccess file on the server. The system information within event espresso is now showing max_input_vars => 3000 .

However, I’m still getting the error relating to it being exceeded.
I’ve re-saved all the settings in EE to try and refresh it to no avail.

Do you know if there is another step that I’m missing?

Thanks again,
Emily


Tony

  • Support Staff

November 12, 2015 at 12:43 am

That’s strange.

How many datetimes and tickets do you have on this event?

When the error is shown, if you add another ticket (give it a name you can spot easily) and update the event, does the ticket save or disappear?


Emily

November 12, 2015 at 2:50 am

I’d only just started creating the event when the error appeared – got as far as entering the title.

After seeing your message I’ve set 3 ticket types and 1 datetime. It does save the new tickets. However, every time I click in the EE editor the error pops up and flicks me back to the top of the page.


Tony

  • Support Staff

November 12, 2015 at 4:01 am

Hmmm, that’s odd.

Can I took at a look at the admin please?

If so you can send temporary login details using this form:

https://eventespresso.com/send-login-details/


Emily

November 12, 2015 at 1:40 pm

Thanks Tony – I’ve sent the details through using that form.


Tony

  • Support Staff

November 13, 2015 at 3:38 am

I suspect this is an issue with caching.

When I logged into your site I was show 502 Bad Gateway, similar to this – http://take.ms/6ykpL

On clicking ‘Retry for live version’ the site loaded and works, but each time the heatbeat api is used on the event page it triggers the max_input_vars notice.

Looking at the headers for that request it is using Cloudflare and nginx which I suspect is causing the problems. Can you disable CloudFlare on your site?


Emily

November 13, 2015 at 2:37 pm

Thanks for your persistence with this Tony.

I’ve now disabled Cloudflare for the website and refreshed the cache.
I’ve also created a rule that if Cloudflare is turned on again it should bypass the wp-admin area.

It doesn’t seem to have made a difference at my end though?


Tony

  • Support Staff

November 16, 2015 at 2:28 am

Hmm, that’s strange.

Are you comfortable editing PHP files?

Within \event-espresso-core-reg\core\EE_Config.core.php around line 2470 you’ll find the ‘max_input_vars_limit_check’ which looks like this:

public function max_input_vars_limit_check( $input_count = 0 ) {
	if ( ( $input_count >= $this->php->max_input_vars ) && ( PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 3 && PHP_RELEASE_VERSION >=9 ) ) {
		return  __('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.', 'event_espresso');
	} else {
		return '';
	}
}

Change that to:

public function max_input_vars_limit_check( $input_count = 0 ) {
	if ( !empty( $this->php->max_input_vars ) && ( $input_count >= $this->php->max_input_vars ) && ( PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 3 && PHP_RELEASE_VERSION >=9 ) ) { 
		return  __('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.', 'event_espresso') . ' Max_input: ' .  $this->php->max_input_vars . ', Current Vars: ' . $input_count;
	} else {
		return '';
	}
}

Which adds a check to the to condition to make sure there is a value for max_input_vars, but also outputs both the current max_input_vars and page input_vars values within the message.

Once that is in place create a new event to trigger the notice, what is shown?


Tony

  • Support Staff

November 16, 2015 at 2:31 am

I’ve added the function to a gist as it should be a little easier to read:

https://gist.github.com/Pebblo/35c7db89a8a70da925b1


Emily

November 16, 2015 at 3:02 am

Hi Tony,

I’ve made that change thanks. The error is still popping up, however it’s now as follows:

“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. Max_input: 5000, Current Vars: 13743″

Does that mean that the number of posts my site is requesting is 13743 while I’ve only enabled 5000?

Thanks,
Emily


Tony

  • Support Staff

November 16, 2015 at 4:06 am

Not posts, input variables, but yes.

Something I didn’t expect was the page to be loading nearly 14,000 input elements. But it turns out it is – http://take.ms/Ruixs

It looks like this is being added by your theme, some are also being added by Visual Composer.

Can you send me a copy of the theme so I can take a look please?

You’ll need to host it somewhere (you can upload it to the site using the media manage if you prefer, or use something like Dropbox) and provide a link we can download it from to support[at]eventespresso.com


Emily

November 16, 2015 at 1:31 pm

Hi Tony,

I’ve sent an email with the link and also some more info about the error. It seems to have been resolved by deleting some of the google calendars on my site.

Thanks again for your time,
Emily


Tony

  • Support Staff

November 16, 2015 at 3:34 pm

Hi Emily,

I have replied to your email but just wanted to add some notes here for future readers.

This issue is not actually being cause by one of the Calendar plugins (it is another symptom), on installing the theme in use on the site locally I ran into the same error.

With no other plugins but EE the theme is adding over 11,000 inputs to the wp admin. This issue goes further than EE as max_input_vars basically means “ignore any input values after x amount of inputs” so if you set max_input_vars to 5000, the values for any inputs after the first 5000 will be completely ignored by the server.

There’s a couple of solutions, one is to update max_input_vars to a really high value to cover all these additional inputs, such as 20,000. However max_input_vars was introduced for a reason and upping the limit so high may have other issues, this is something you will need to discuss with your host.

The other is to switch to another theme that doesn’t add all of these inputs to the page, this is not a quick fix and may be fairly involved.

It isn’t an issue with EE itself, EE is detecting the amount of inputs within the page and throwing a warning to tell you there are more inputs than your server will handle.

The support post ‘max_input_vars not updating’ 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