Skip to content

Knowledgebase

Changing PHP limits for one Virtualmin website

control-panels, development

Adjust PHP limits for the selected Virtualmin website only after identifying the setting responsible for a measured failure. Domain PHP configuration, FPM pool behaviour and web-server request limits are related but separate controls.

Prepare for the change

Record the domain PHP version and mode, the current values and the exact error. Take a configuration backup and confirm the service memory allocation. A PHP limit should fit the workload and available resources instead of being raised to an arbitrary unlimited value.

01 Change PHP limits for one Virtualmin website

  1. Select the virtual server and inspect its Web Configuration PHP options and configuration controls. Confirm that you are editing the domain runtime rather than a global PHP installation or the Webmin panel runtime.
  2. For upload failures, review upload_max_filesize and post_max_size together. For memory exhaustion, identify which operation consumes memory and whether it can be processed in smaller batches.
  3. Make one justified INI adjustment through the supported domain interface. Preserve the previous value and valid syntax.
  4. Apply any required configuration reload reported by the panel. Avoid restarting every PHP version if only one domain pool is affected.
  5. Repeat a safe version of the original operation and check the effective value in its web environment.
  6. Review PHP-FPM process capacity separately from per-request memory. Multiplying a high memory limit by many concurrent workers can exceed physical RAM even if one request succeeds.

02 Example: consider concurrent PHP work before raising a limit

As a planning example, twelve concurrent requests each approaching a 256M PHP memory limit would account for roughly 12 × 256 MiB = 3 GiB of PHP-accounted memory alone. The operating system, database, web server and process overhead still need capacity.

This is an illustration, not a recommended worker count or a prediction that every request reserves that much memory. Actual process memory and workload vary. Measure representative worker use and concurrency before increasing a domain limit or pool capacity. If a single import is the cause, application-supported batching may be preferable to permitting every request a much larger ceiling.

Retest normal concurrent traffic after the scoped change and watch for worker failures or out-of-memory events. A single successful upload does not establish that the complete server has enough capacity.

Does a larger memory_limit reserve more memory?

No. It raises the maximum PHP may use for a request. It neither adds RAM nor guarantees enough capacity when many requests run together.

Confirm the expected result

Confirm the operation completes and that neighbouring sites remain healthy. Compare resource use and new errors under a representative workload. Remove temporary diagnostics and keep detailed error display disabled for public users.

If the change does not work

If the change has no effect, inspect the selected runtime, application-level limits and upstream server/proxy timeouts. A timeout caused by a slow database query should lead to query diagnosis. Restore the previous value if memory pressure or worker failures worsen.

Was this answer helpful?

Need a little more help?

Our support team can help you find the next step.

Contact support