The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Increase max_input_vars in php.ini WHM

Discussion in 'General Discussion' started by markuswest, Nov 6, 2013.

  1. markuswest

    markuswest Active Member

    Joined:
    Oct 21, 2013
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hi,

    For one of my applications on a website I need to increase the "max_input_vars" in php.ini from the default 1000 to 9999 how can I do this one?

    I wonder where and how should I configure this one on WHM or should I do it in the cPanel (cPanel of the website)
     
  2. ITGabs

    ITGabs Well-Known Member

    Joined:
    Jul 30, 2013
    Messages:
    81
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hi,

    This option should be in WHM -> Service Configuration -> PHP Configuration Editor -> advanced
    But is not there

    Workarounds...
    You can try it adding this at the beginning of your script ini_set('max_input_vars', 9999);

    or in the .htaccess

    php_value max_input_vars 9999

    or copy the main php.ini and add this line if you don't find max_input_time

    max_input_time = 9999

    the php.ini in Cpanel is on /usr/local/lib/php.ini
    you can use
    cp /usr/local/lib/php.ini /home/[cpuser]/public_html/php.ini
    nano /usr/local/lib/php.ini

    If you use Suhosin or Fast CGI you may need additional steps

    for Suhosin:
    php_value suhosin.get.max_vars
    php_value suhosin.post.max_vars
    php_value suhosin.request.max_vars

    for mod fcgid
    cat /usr/local/cpanel/cgi-sys/php5

    and check this line:
    [[ -f ~/public_html/php.ini ]] && exec /usr/bin/php -c ~/public_html/php.ini

    so the account php.ini should be only in /home/[cpuser]/public_html/php.ini

    There are other ways using .user.ini but I didn't see it working with Cpanel
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Check to make sure you are using PHP 5.3.9 or higher because the "max_input_vars" configuration value has only been available since that version of PHP. If you want to change the value for the entire server, modify /usr/local/lib/php.ini and then restart Apache.

    Thank you.
     
  4. MaraBlue

    MaraBlue Well-Known Member

    Joined:
    May 3, 2005
    Messages:
    335
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Carmichael, CA
    cPanel Access Level:
    Root Administrator
    The line "max_input_vars = 5000" (or whatever value you want to change it to) will likely need to be added. The value is showing, but that line wasn't in my php.ini, v5.3.27.

    # php -i | grep max_input_vars
    max_input_vars => 5000 => 5000
     
Loading...

Share This Page