Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent setting the PHP variable max_input_vars since it is read only #3349

Closed
YongBoLiu opened this issue Mar 16, 2020 · 2 comments
Closed
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@YongBoLiu
Copy link
Contributor

Describe the bug
A clear and concise description of what the bug is.

When select more than 1000 hosts in one cation, get the errors as below, in error_log of httpd.

[Wed Mar 11 02:51:33.188573 2020] [:error] [pid 3272] [client 9.197.250.110:55005] PHP Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. in Unknown on line 0, referer: http://9.21.55.81/cacti/...

To Reproduce
Steps to reproduce the behavior:

  1. select 1000+ hosts in some plugins,
  2. take the action to open/close the devices.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
The max_input_vars can't be set in user's code. Because it's changeable is PHP_INI_PERDIR.
So, we have to change php.ini if we support open/close 1000 hosts in one action.

#find . -name "*php"|xargs grep ini_set.*max_input_vars

./cacti/include/global.php:ini_set('max_input_vars', '5000');
./cacti/include/global.php: ini_set('max_input_vars', '5000');

Ref:
https://stackoverflow.com/questions/9973555/setting-max-input-vars-php-ini-directive-using-ini-set

https://www.php.net/manual/en/info.configuration.php

@YongBoLiu
Copy link
Contributor Author

Although it's not effect any feature in cacti native, we should remove these settings.

@TheWitness TheWitness added the bug Undesired behaviour label Mar 16, 2020
@TheWitness TheWitness added this to the 1.2.11 milestone Mar 16, 2020
@TheWitness TheWitness changed the title set max_input_vars in code is not useful Variable max_input_vars is read only. Attempting to change it adds no value Mar 16, 2020
TheWitness added a commit that referenced this issue Mar 16, 2020
Variable max_input_vars is read only.  Attempting to change it adds no value
@TheWitness TheWitness added the resolved A fixed issue label Mar 16, 2020
@TheWitness
Copy link
Member

Fixed.

@netniV netniV changed the title Variable max_input_vars is read only. Attempting to change it adds no value Prevent setting the PHP variable max_input_vars since it is read only Apr 5, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

2 participants