Wordpress FIle Size LImits

OS type and version Ubuntu 22.04.2
Virtualmin version 7.5 Pro

So how would i go about changing the upload limits for my WordPress site on a Virutalmin server? PHP 8.2 settings show my resource limit is 2M but i can easily upload files that are 8M. Its when i get to 10M that i run into this issue. Changing the PHP limit wouldn’t do anything since that appears to be ignored as it is.

I think you need to increase post_max_size as well in the GUI that maybe Maximum HTTP POST size.
Also restart the PHP-FPM server.

Where might that be? I don’t think it’s the PHP settings…as mentioned, the PHP settings State max size is 2MB, but I can easily upload an 8 MB file

Look for the PHP Configuration item under Services (or perhaps its labeled PHP-FPM Configuration – depending on what your php mode is set at) for your Virtual Server. On that panel you should increase both max file upload size and max http post size as mentioned before.

I believe when you click SAVE at the bottom, the PHP and/or apache services will be reloaded automatically.

As you may know, you can check the php config remotely to verify the actual settings with a xxxx.php file on the website (that is, you create a PHP file then browse to that URL in your browser) containing only

<?php phpinfo() ?>

or if you prefer just one line, I think this works too

<?php phpinfo() ?>


Under webmin
So there is 2 settings, this is global setting BTW.

if you’re using php-fpm (check virtual server → Server configuration → PHP settings), then go to virtual server → Services → php-fpm configuration → resource limits.
adjust ‘maximum file upload size’ and ‘maximum http post size’ to whatever eg. 8M.

Everyone, you are all missing…my PHP settings are not the issue. Right now the PHP upload setting is set to 2MB…I can upload files larger than 2. And the HTTP post is set to 15Mb but I can’t upload more than 10MB

so, it’s obviously php settings someplace.

Do a search for php.ini and I’m willing to bet you have 4 or 5 different ones. One of them is what’s causing the different result.

do not use the .htaccess snip it won’t work. As wordpress is written in PHP, it’s limits will always be limited to how php is set up … on the domain you are using to host wp which version of php are you using ?
use vmin->domain->Server Configuration-> php options to find out.
upload a copy of the output from phpinfo().
To get php info
create a file on the domain in question add
<?php phpinfo();
then navigate to the file through a browser. It will also tell you which php.ini file is being used

quick screen shot up should see this


But in my PHP settings show PHP versions installed 8.0.28, 8.1.17, 8.2.4

That is why I told you to do a search for php.ini in your file manager. You will have a php.ini for every version you listed. Typically, only one will dictate what file size is allowed, so you have to find them all and change them all to match or get rid of every version you’re not using.

what are the limits in that file ? when you edit them don’t forget to restart the service that php is running with e.g fpm for the edits to take place easiest way is webmin->tools->php configuration from that screen choose the correct ini file, click manage, then edit resource limits , while your there you could edit all of the files to match

Recommended PHP Configuration Limits

  • max_execution_time 300
  • memory_limit 128M/216M
  • post_max_size 32M
  • upload_max_filesize 32M
  • PHP Time Limit: 300
  • Max input Vars: 2600

recommended for what php website exactly? there are different needs for a simple wordpress blog/personal webpage and different needs for eg. a woocommerce eshop.

300" execution time seems too much. why?
a big/slow php script on a page would allow anyone to ddos your system for 5’ on each request… most wordpress sites should be fine with 30", or 60".
imho if a php script doesn’t finish at 30"/60" then it should be debugged and fixed, or it’s terrible code…

max input vars php default (1000) should also be fine for most wordpress sites. if a plugin requests more (eg. woocommerce addon or whatever else) then yes, increase accordingly.

memory_limit 128M is pretty ok for a blog or a simple wordpress site. for a woocommerce site or one using those lousy page builder plugins (elementor, etc), that’s low and would make the site slow/buggy as well. 256M if you can afford RAM on those.


I can upload a 9MB file no issue

You will probably find that those settings are overridden by individual domain settings.

Select the domain, then Services, PHP-FPM Configuration, Resource Limits.
You will notice that the line just under the title Resource Limits ends in a long number.conf which is for that specific domain.

Same under the individual domain setting

That doesn’t seem cohesive to need to do for ever server/domain I add to Virtualmin…no one stop shop to change default php upload size?