/go/maxinputtime: maxinputtime from the Command Line

/go/maxinputtime sets PHP's max_input_time in the php.ini file of every installed PHP version at once. This is the longest PHP may spend reading and parsing the data sent to a script, such as form fields and uploaded files. It does not limit how long the script itself runs (see maxexecutiontime). The command: Slow connections uploading large files are the usual reason to raise this value. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# Set the default (600 seconds) in every php.ini
/go/maxinputtime

The new value is live about a minute later.

Options

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

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

What the value means to PHP:

Value Meaning
A positive number PHP may spend that many seconds parsing input.
0 No limit.
-1 PHP uses max_execution_time instead. This is PHP’s own default when nothing is set.

Examples

# Use the default of 600 seconds
/go/maxinputtime

# Allow 5 minutes for slow uploads
/go/maxinputtime 300

# Make PHP use max_execution_time instead
/go/maxinputtime -1

# Show the current value
/go/maxinputtime return

# Apply the change immediately instead of waiting for the scheduled reload
/go/maxinputtime 300 && /go/fpm

Output

Outcome What you get
Value set Max Input Time updated successfully.
return The value from the first php.ini found. Blank if that file has no max_input_time line.

When a php.ini file already has a max_input_time line at the start of a line, that line is printed first, once per file, showing the previous value. For example:

max_input_time = 60
max_input_time = 60
Max Input Time updated successfully.

These extra lines are normal and can be read as a before-picture. They are not errors.

The success message is printed even if no php.ini file was found, so it does not prove that anything changed. This includes servers whose operating system the script doesn’t recognize, which is not reported. Check with return.

The scheduled reload prints nothing. Every run is also recorded in /var/log/go/maxinputtime.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/maxinputtime 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 *