post_max_size limits the total size of the data PHP will accept in one POST request. It includes form fields and file uploads, so it caps how large an upload can be, no matter how high upload_max_filesize is. /go/postmaxsize changes this setting for the whole server in one step. It: Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.
Quick start
# Set post_max_size to 64M (the default) in every php.ini
/go/postmaxsize
# Set it to 128M
/go/postmaxsize 128M
# Print the current value
/go/postmaxsize return
Options
There are no --option flags. The only arguments are:
| Argument | Required | Default | Notes |
|---|---|---|---|
<value> |
No | 64M |
Written exactly as given. See valid values. |
return |
No | — | Read-only mode. Must be the first argument. |
Valid values
The script does not validate the value. It writes whatever you type, so use a form PHP understands:
| Form | Meaning |
|---|---|
8M, 64M, 128M |
Megabytes. |
1G |
Gigabytes. |
512K |
Kilobytes. |
67108864 |
Plain bytes. |
0 |
No limit. Not recommended on a shared server. |
A value containing / or & can break the sed replacement and corrupt the line. A value with spaces (such as 128 M) is written as-is and is not valid PHP.
Examples
# Allow uploads of up to about 256 MB (raise upload_max_filesize too)
/go/postmaxsize 256M
/go/uploadmaxfilesize 256M
# Check the current value
/go/postmaxsize return
# Reset to the GoAdmio default
/go/postmaxsize
# Apply the change right away instead of waiting a minute
/go/postmaxsize 128M && /go/fpm reload
Output
| Outcome | What you get |
|---|---|
| Value set | Post Max Size updated successfully. |
return mode |
The current value only, for example 64M. |
| Unsupported OS | Unknown operating system. Nothing is changed. |
Notes on the output:
- The success message is printed even if no php.ini files were found, so it does not prove a file changed. Check with
/go/postmaxsize return. returnmode exits with status 1, even though it succeeds. Do not use it afterset -eor in an&&chain. Capture it with command substitution instead:
current=$(/go/postmaxsize return)
- Every run, including
return, is logged with a timestamp and its arguments to/var/log/go/postmaxsize.log.
See the full reference at /go/postmaxsize 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.
