Manage 1000+ categories in Osclass

If your osclass site will contain more than 1000 categories this will cause an issue for custom fields or plugins that will be displayed only in a specific category.  In most cases, the plugin will have a config page where you will set in which categories the plugin or custom field will be displayed.

max_input_vars  Available since PHP 5.3.9 will limit the number of input variable that can be accepted to 1000 (limit is applied to $_GET, $_POST, and $_COOKIE superglobal separately)

This means that you can only get only 1000 variable from a post action, such as setting the categories for a plugin or a custom field in Osclass. This will cause an issue if you want to set more than 1000 categories to a plugin, the number of categories that exceed the limit will not be saved for that plugin or custom field.

You can change the value of max_input_vars in php.ini but in most cases, you will not have access to that configuration file so instead of that we can create a configuration file in our site root folder.

You need an FTP client like FileZilla or you can use file manager available in CPanel to follow the next steps in creating the necessary files on your server.

Go in the root (public_html)folder of your site and create a file .user.ini

- make sure that you have the extension ini and you don't exclude the dot before .user

Include this line in that file

 max_input_vars = 3000

- 3000 is the number of the input variable accepted, change this value according to your demands

Now you can set more than 1000 categories to a plugin or custom field from Osclass, just by changing the limit number for global variables $_POST, $_GET.

Subscribe
X

Subscribe!

Subscribe to get the latest listings, updates and special offers delivered directly in your inbox.