GoAdmio Command Line: maxinputvars with /go/maxinputvars

/go/maxinputvars sets PHP's max_input_vars in the php.ini file of every installed PHP version at once. This is the maximum number of input variables PHP accepts in one request, counted separately for GET (the address), POST (form data), and cookies. Each form field counts, and so does every item in an array field such as items[]. The command: PHP's own default is 1000. Pages that send very large forms (for example a content management system's menu editor or a product with many variations) can exceed it. When a request goes over the limit, PHP silently drops the extra variables, so part of the form may not be saved. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# Set the default (3000 variables per request) in every php.ini
/go/maxinputvars

The new value is live about a minute later.

Options

This command has no options. It takes one optional argument.

Argument Required Default Notes
<number> No 3000 A whole number of variables. Nothing checks the value (see Validation).
return No — Prints the current value instead of setting one.

Examples

# Use the default of 3000 variables
/go/maxinputvars

# Allow 5000 variables per request
/go/maxinputvars 5000

# Show the current value
/go/maxinputvars return

# Apply the change immediately instead of waiting for the scheduled reload
/go/maxinputvars 5000 && /go/fpm

Output

Outcome What you get
Value set Max Input Vars updated successfully.
return The number from the first php.ini found. Blank if that file has no max_input_vars line starting at the beginning of a line.
Unsupported operating system Unknown operating system. Nothing is changed.

The success message is printed even if no php.ini file was found, so it does not prove that anything changed. Check with return.

The scheduled reload prints nothing. Every run is also recorded in /var/log/go/maxinputvars.log.

[!NOTE]
return ends with exit status 1, and return does not schedule a reload. In scripts, read the output instead of relying on the exit status.

See the full reference at /go/maxinputvars and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *