Skip to content

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

Closed

Description

@YongBoLiu

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

Activity

  1. YongBoLiu commented on Mar 16, 2020

    @YongBoLiu
    ContributorAuthor

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

  2. added this to the 1.2.11 milestone on Mar 16, 2020
  3. 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[/+] on Mar 16, 2020
  4. added a commit that references this issue on Mar 16, 2020
  5. TheWitness commented on Mar 16, 2020

    @TheWitness
    Member

    Fixed.

  6. 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[/+] on Apr 5, 2020
  7. locked and limited conversation to collaborators on Jul 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUndesired behaviourresolvedA fixed issue

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions