Upload max filesize/Post max size

Hello there,

I use webmin / Virtualmin and how to change the values of Upload max filesize/Post max size (Upload max filesize 20M /Post max size 40M) ​​for a virtual server that I created in Virtualmin and how to ensure that these values ​​are the default values ​​when creating a new server? Please Thanks



In virtualmin if you change the php.ini config with the increased values in ‘Services / PHP 5 Configuration’ under the virtual server in the first section at the top or anywhere within that section, It’s only available for that virtual host as it edits the php ini file in the vhost directory.

If however you have edited the main php template by hand or via ‘webmin / others / PHP Configuration’ where it shows ‘Global PHP configuration’ or anywhere outside the virtualmin top section config and users home directory then there’s a good chance the changes are for for everything created after the change all current sites won’t change as they have there own php.ini files already.

You can always make a new host and test uploads to see if there default or custom.

Hello there

thank you for the answer.

I fai this:
In Virtualmin if you change the php.ini configuration with increased in 'Services / PHP 5 Configuration "under the virtual server in the first section at the top or anywhere in this article values, it is only available for this virtual host because it changes the ini file in the directory php virtual server.

but the changes are not taken into concideration malgres a reboot of the Apache server.

What should I do? What can I do?

Please Thanks


They should stick the changes, it’s not a temporary change as you are editing and saving the actual file via virtualmin.

I just changed my upload from 2mb to 10mb as a test in the vhosts php config area and just did a reboot as a test and changes still apply.

You can see a screenshot of it here.

As you see I edited the php config for that specific vhost and and clicked save then rebooted the entire server as a extreme test based on your reply, and the changes still applied, I didn’t just change them before the pic was taken to fool you.

If the changes aren’t saving and not continuing to be applied after a reboot, then you probably have a more serious file permission issue between virtualmin and directories, users etc. But thats out of my knowledge unfortunately and a recent fresh install I did, does save over reboots as you can see.

Are you making sure you log in as root/sudo user when trying to save etc which is what I was when I saved the changes?

Ahhh I see your original answer you want them as defaults.

My screenshot above will show you for current servers.

For global one way if its there is a better way I’m not sure would be to change them in the Webmin (tab) / Others / PHP Configuration / Manage button / then Resource Limits.

But I don’t know if there’s a better way to do this so make sure you take note of what you change just incase you need to revert.

From virtualmin, that way seems to be the best globally I think for new servers.

Template PHP configuration file

By default, when a virtual server runs PHP scripts as the server’s owner, Virtualmin will copy the system’s global PHP configuration file (usually /etc/php.ini) to the domain’s ~/etc directory. This allows PHP options to be set differently on a per-server basis.

Screenshot to help you.

Then you will see a screen to above and click Resources button in the middle with the 2 blue bars.

That will do it on a global scale for all new servers current ones you will need to edit as my first screenshot.

And Yes changes do stick over reboot.

Be warned if you are changing them there set low initially for a reason and yes you need to change them occasionally for things, last thing you are wanting to do is globally allow every host uploading 40mb files to your server. So have a good think why you want to make the change and if its needed on every site or not.

Hello there,

Thank you for this answer.

I could, indeed, according to your specifications, change my values (Upload max filesize/Post max size) ​​for a given field.

But when I wanted to make the change so that the change to occur for any new domain created, I did not find the file you specify (webmin / other / php configuration) / etc / php.ini. In my case webmin offers me three files, which are:

Configuration file Purpose Actions
/ etc/php5/apache2/php.ini Configuration for mod_php Manage | Edit Manually
/ etc/php5/cgi/php.ini Configuration for scripts run via CGI Manage | Edit Manually
/ etc/php5/cli/php.ini Configuration for command-line scripts Manage | Edit Manually

on which file should I make my changes so that they are taken into effect for each new domain created? Please Thanks

have a nice day


I’m not exactly sure what one virtualmin gets its changes from.

I know its not the CLI so its one of the other 2.

Try changing the apache one first as I showed in ‘Resource Limits’ make a note of the change etc, then test it by creating a new vhost/‘Virtualmin server’ remember current ones use their own php.ini files if that doesn’t work you know its the CGI php ini file, if it does on a new site test then you’re good to go.

If not revert the changes for the apache php and save and then do the changes to the cgi and apply and test on a new site.

That should usually be your procedure if you are unsure change something making a note of what you change, test it, then revert it afterwards if it doesn’t work before testing something else or the next thing.

NEVER EVER make a string of changes without making a note and then reverting back straight after before you test something else.

I know this happens all too often people make a change it doesn’t work, then they go make more changes then more changes and before they know it they have changed 150+ settings and variables trying to fix 1 thing and ultimately need to re-install because its too much to remember and change back.

It is mostly safe to test stuff and break stuff (its how we learn) especially testing like this, as long as you revert back to the exact way it was straight after.

Agreed that some changes like this will although rarely break the server needing a re-install if you edit a core file etc so just be smart before making changes also.