Background
To adjust the PHP memory limit using Virtualmin, do the following:
1. Log into Virtualmin
2. From the dropdown at the top, choose the requisite virtual host that you want to change the settings for, then:
Services -> PHP 7.2 configuration
Description of the limits:
memory_limit
(Maximum memory allocation)upload_max_filesize
(Maximum file upload size)max_input_time
(Maximum input parsing time)post_max_size
(Maximum HTTP POST size)max_execution_time
(Maximum execution time)
Once you have made the changes, click Save
. You do not have to restart Apache as the new settings will take affect after a couple of seconds.
If you want to change the maximum execution time of a PHP script, navigate to:
Server Configuration -> Website Options
There you will find max_execution_time
Note about upload_max_filesize
and post_max_size
On an Nginx server a user complained that their WordPress import tool was limited to 10 MB in spite of them upping the value of upload_max_filesize
to 64MB. It turns out to get this to properly work one has to also adjust post_max_size
as well to be the same as upload_max_filesize
. See screenshot below.
Services –> PHP-FPM Configuration –> Resource Limits
Maximum PHP script run time
When PHP scripts are run using FCGId mode, this field sets the maximum time each script call can run for. You may need to increase it when hosting scripts that have particularly high run times, and are timed out by your web server configuration before completion.
If you are unsure which PHP version you are using, navigate to:
Server Configuration -> PHP Versions
Note for WHMCS users:
You may need to adjust limits if you’re using WHMCS, for example, see the WHMCS recommended settings here:
- A PHP Memory limit of at least 128MB
- PHP max_execution_time in excess of 60 seconds