{"id":641,"date":"2024-08-18T19:34:30","date_gmt":"2024-08-18T19:34:30","guid":{"rendered":"https:\/\/webhostingpune.co.in\/blog\/?p=641"},"modified":"2024-08-18T19:41:47","modified_gmt":"2024-08-18T19:41:47","slug":"php-max-input-vars-increase-it-in-cpanel","status":"publish","type":"post","link":"https:\/\/webhostingpune.co.in\/blog\/php-max-input-vars-increase-it-in-cpanel\/","title":{"rendered":"How to increase the PHP Max Input Vars"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">PHP Max Input Vars variable max_input_vars was introduced in PHP as a security measure to limit the maximum number of POST variables sent. It represents the number of variables your server can use to run a function.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you get the error \u201c<strong>Increase PHP Max Input Vars Limit<\/strong>\u201d in WordPress, you must increase the PHP max_input_vars value.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#what-is-the-php-input-vars\">What is the PHP Input Vars?<\/a><\/li><li><a href=\"#how-to-increase-php-max-input-vars-limit\">How to Increase PHP Max Input Vars Limit?<\/a><ul><li><a href=\"#option-1-use-the-select-php-version-tool-in-c-panel\">Option 1: Use the \u201cSelect PHP Version\u201d Tool in cPanel<\/a><\/li><li><a href=\"#option-2-edit-the-htaccess-file\">Option 2: Edit the .htaccess File<\/a><\/li><li><a href=\"#option-3-edit-the-php-ini-file\">Option 3: Edit the PHP.ini File.<\/a><\/li><\/ul><\/li><li><a href=\"#conclusion\">Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">This post explains how to change the maximum number of PHP script input variables for your web hosting account to meet specific application needs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are many different methods to\u00a0<strong>increase PHP Max Input Vars in WordPress<\/strong>. However, this entirely depends on the\u00a0<a href=\"https:\/\/www.webhostingpune.co.in\/web-hosting\/\">hosting provider<\/a>\u00a0you are using.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Remember that you may not have specific permissions to increase the maximum PHP input variable limit. Therefore, contact your hosting provider beforehand and ask them to grant you the necessary permissions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-the-php-input-vars\">What is the PHP Input Vars?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before we dive into the methods to increase PHP Max Input Vars, let us cover what exactly is PHP Input Vars. The Max Input Var value represents how many variables for a single function your server can use to avoid overloads. Depending on your script or website, you may need to change this value.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Although the default value for&nbsp;<code>max_input_vars<\/code>&nbsp;is usually enough, you may receive the error \u2018Increase PHP Max Input Vars Limit\u2019. The limit can easily be reached if the PHP developer has created a bulk editing\/processing functionality.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This error can cause a lot of issues on your website\u2019s performance, as well as cause issues with your Plugins or Theme. For example, you may lose all of your data in your theme options or the template you are using may lose its functionality. In addition, the activated widgets on your website may disappear.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Note: This issue was addressed in WordPress 4.5 and above. If you\u2019re not&nbsp;running the latest version of WordPress, we highly recommend upgrading instead of performing the described changes below.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-increase-php-max-input-vars-limit\">How to Increase PHP Max Input Vars Limit?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">There are many different methods to increase the PHP Max Input Vars.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here we discuss of 3 options to increase the PHP Max Input Vars Limit by adding lines to the .htaccess file, php.ini, and done automatically from the PHP selector in cPanel<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"option-1-use-the-select-php-version-tool-in-c-panel\">Option 1: Use the \u201cSelect PHP Version\u201d Tool in cPanel<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This is the easiest method for setting the limit of input variables for your entire hosting account. All you have to do is:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Log into your\u00a0<a href=\"http:\/\/cpanel.net\/\" target=\"_blank\" rel=\"noreferrer noopener\">cPanel<\/a>;<\/li>\n\n\n\n<li>Find and click on the \u2018Select PHP Version\u2019 under the \u2018Software\u2019 section:<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"293\" src=\"https:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2024\/08\/image-1024x293.png\" alt=\"\" class=\"wp-image-649\" srcset=\"https:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2024\/08\/image-1024x293.png 1024w, https:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2024\/08\/image-300x86.png 300w, https:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2024\/08\/image.png 1100w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Once you\u2019re inside, click on \u2018Switch to PHP Options\u2019:<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"971\" height=\"223\" src=\"https:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2024\/08\/Screenshot-2024-02-24-085518.webp\" alt=\"\" class=\"wp-image-650\" srcset=\"https:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2024\/08\/Screenshot-2024-02-24-085518.webp 971w, https:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2024\/08\/Screenshot-2024-02-24-085518-300x69.webp 300w\" sizes=\"auto, (max-width: 971px) 100vw, 971px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">After switching, scroll down and you will see the\u00a0<code>max_input_vars<\/code>\u00a0with a drop-down right beside it. Use the drop-down to set your desired limit.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"551\" src=\"http:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2024\/08\/set-max-input-vars.webp\" alt=\"\" class=\"wp-image-651\" srcset=\"https:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2024\/08\/set-max-input-vars.webp 969w, https:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2024\/08\/set-max-input-vars-300x171.webp 300w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"option-2-edit-the-htaccess-file\">Option 2: Edit the .htaccess File<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">As a second and preferred option, you can set the&nbsp;<code>max_input_vars<\/code>&nbsp;per application. Before making any changes to the file, ensure you&nbsp;<strong>get a backup of your site<\/strong>&nbsp;or at least of this file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this example, we will use the cPanel File Manager, but you can do it via an FTP Client like FileZilla as well. Follow these steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Log into your cPanel;<\/li>\n\n\n\n<li>Locate\u00a0<strong>File Manager<\/strong>, which is under the \u2018Files\u2019 section:<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1087\" height=\"289\" src=\"https:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2024\/08\/image-1.png\" alt=\"\" class=\"wp-image-652\" srcset=\"https:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2024\/08\/image-1.png 1087w, https:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2024\/08\/image-1-300x80.png 300w, https:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2024\/08\/image-1-1024x272.png 1024w\" sizes=\"auto, (max-width: 1087px) 100vw, 1087px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Once inside the File Manager, click on \u2018Settings\u2019 at the top-right corner, and then enable\u00a0<strong>Show Hidden Files<\/strong>\u00a0(dotfiles):<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"970\" height=\"563\" src=\"https:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2024\/08\/check-show-hidden-files-in-settings.webp\" alt=\"\" class=\"wp-image-653\" style=\"width:748px;height:auto\" srcset=\"https:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2024\/08\/check-show-hidden-files-in-settings.webp 970w, https:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2024\/08\/check-show-hidden-files-in-settings-300x174.webp 300w\" sizes=\"auto, (max-width: 970px) 100vw, 970px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>After you do that, locate the\u00a0<code>.htaccess<\/code>\u00a0file of your desired application.<\/li>\n\n\n\n<li>Select the\u00a0<code>.htaccess<\/code>\u00a0file, and click the right mouse button over it. Select \u2018Edit\u2019, and after you get a pop-up window, click on the button \u2018Edit\u2019 again to confirm:<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"970\" height=\"422\" src=\"https:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2024\/08\/edit-htaccess-file-in-file-manager.webp\" alt=\"\" class=\"wp-image-654\" style=\"width:864px;height:auto\" srcset=\"https:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2024\/08\/edit-htaccess-file-in-file-manager.webp 970w, https:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2024\/08\/edit-htaccess-file-in-file-manager-300x131.webp 300w\" sizes=\"auto, (max-width: 970px) 100vw, 970px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Once inside the\u00a0<code>.htaccess<\/code>\u00a0file, you need to add the following line at the end or beginning of the file:php_value max_input_vars 3000If you are using Suhosin, add the following to the file instead:<code>php_value suhosin.request.max_vars 2000<br>php_value suhosin.post.max_vars 2000<\/code>Where 3000 stands for your variable limit, and it should be what the specific application is requiring. If it\u2019s WordPress, 3000 should be enough for any occasion.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"option-3-edit-the-php-ini-file\">Option 3: Edit the PHP.ini File.<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The following method to increase the PHP max input vars limit in WordPress is editing the php.ini file. Follow the Same steps as shared above on Edit the .htaccess File<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This file is also in the root directory of your host, where you have installed WordPress.<br>If you can\u2019t find it, create a new empty php.ini file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In either case, open the file in an editor and add the following code to it:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>max_input_vars = 5000<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Don\u2019t forget to save the changes and reboot your server once to use the newly added data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The&nbsp;<code>max_input_vars<\/code>&nbsp;variable should be as lowest as possible as if it is greater one it opens the door to abusive behavior mostly with DDoS attacks hash collisions. This is the reason why we keep that variable lower on all our shared hosting plans.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you are getting the same error message and the suggested fix does not resolve the issue for you please contact our technical support team as they will investigate and surely resolve this issue for you.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP Max Input Vars variable max_input_vars was introduced in PHP as a security measure to limit the maximum number of POST variables sent. It represents the number of variables your server can use to run a function. If you get the error \u201cIncrease PHP Max Input Vars Limit\u201d in WordPress, you must increase the PHP max_input_vars value. This post explains how to change the maximum number of PHP script input variables for your web hosting account to meet specific application needs. There are many different methods to\u00a0increase PHP Max Input Vars in WordPress. However, this entirely depends on the\u00a0hosting provider\u00a0you are using. Remember that you may not have specific permissions to increase the maximum PHP input variable limit. Therefore, contact your hosting provider beforehand and ask them to grant you the necessary permissions. What is the PHP Input Vars? Before we dive into the methods to increase PHP Max Input Vars, let us cover what exactly is PHP Input Vars. The Max Input Var value represents how many variables for a single function your server can use to avoid overloads. Depending on your script or website, you may need to change this value. Although the default value for&nbsp;max_input_vars&nbsp;is usually enough, you may receive the error \u2018Increase PHP Max Input Vars Limit\u2019. The limit can easily be reached if the PHP developer has created a bulk editing\/processing functionality. This error can cause a lot of issues on your website\u2019s performance, as well as cause issues with your Plugins or Theme. For example, you may lose all of your data in your theme options or the template you are using may lose its functionality. In addition, the activated widgets on your website may disappear. Note: This issue was addressed in WordPress 4.5 and above. If you\u2019re not&nbsp;running the latest version of WordPress, we highly recommend upgrading instead of performing the described changes below. How to Increase PHP Max Input Vars Limit? There are many different methods to increase the PHP Max Input Vars. Here we discuss of 3 options to increase the PHP Max Input Vars Limit by adding lines to the .htaccess file, php.ini, and done automatically from the PHP selector in cPanel Option 1: Use the \u201cSelect PHP Version\u201d Tool in cPanel This is the easiest method for setting the limit of input variables for your entire hosting account. All you have to do is: After switching, scroll down and you will see the\u00a0max_input_vars\u00a0with a drop-down right beside it. Use the drop-down to set your desired limit. Option 2: Edit the .htaccess File As a second and preferred option, you can set the&nbsp;max_input_vars&nbsp;per application. Before making any changes to the file, ensure you&nbsp;get a backup of your site&nbsp;or at least of this file. In this example, we will use the cPanel File Manager, but you can do it via an FTP Client like FileZilla as well. Follow these steps: Once inside the File Manager, click on \u2018Settings\u2019 at the top-right corner, and then enable\u00a0Show Hidden Files\u00a0(dotfiles): Option 3: Edit the PHP.ini File. The following method to increase the PHP max input vars limit in WordPress is editing the php.ini file. Follow the Same steps as shared above on Edit the .htaccess File This file is also in the root directory of your host, where you have installed WordPress.If you can\u2019t find it, create a new empty php.ini file. In either case, open the file in an editor and add the following code to it: max_input_vars = 5000 Don\u2019t forget to save the changes and reboot your server once to use the newly added data. Conclusion The&nbsp;max_input_vars&nbsp;variable should be as lowest as possible as if it is greater one it opens the door to abusive behavior mostly with DDoS attacks hash collisions. This is the reason why we keep that variable lower on all our shared hosting plans. If you are getting the same error message and the suggested fix does not resolve the issue for you please contact our technical support team as they will investigate and surely resolve this issue for you.<\/p>\n","protected":false},"author":2,"featured_media":648,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[1,10],"tags":[],"class_list":["post-641","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-website-building"],"_links":{"self":[{"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/posts\/641","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/comments?post=641"}],"version-history":[{"count":7,"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/posts\/641\/revisions"}],"predecessor-version":[{"id":655,"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/posts\/641\/revisions\/655"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/media\/648"}],"wp:attachment":[{"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/media?parent=641"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/categories?post=641"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/tags?post=641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}