# Optimising WordPress PHP settings for performance

> Getting PHP settings right is one of the most effective things you can do to keep a WordPress site running smoothly. This guide explains what the key settings control, how to adjust them safely using the CloudLinux PHP Selector in cPanel, and how to avoid common mistakes that can cause more problems than they solve.

Source: https://www.kualo.com/knowledgebase/wordpress-optimisation/optimising-wordpress-php-settings-for-performance
Updated: 2026-06-08

---

Getting PHP settings right is one of the most effective things you can do to keep a WordPress site running smoothly. This guide explains what the key settings control, how to adjust them safely using the CloudLinux PHP Selector in cPanel, and how to avoid common mistakes that can cause more problems than they solve.

## What the key PHP settings do

WordPress relies on PHP to build every page, process every form, and run every plugin. A handful of PHP settings directly affect how well it does that job.

**memory_limit**
This sets the maximum amount of memory a single PHP process can use. When WordPress loads a page, runs a WooCommerce checkout, or saves a complex Elementor layout, PHP needs enough memory to complete the task. If it runs out, you will typically see a white screen, a fatal error, or a plugin that silently fails.

**max_execution_time**
This is the maximum number of seconds a PHP script is allowed to run before the server stops it. Bulk import plugins, WooCommerce order processing, and page-builder saves can all take longer than the default allows, resulting in timeout errors if the limit is too low.

**upload_max_filesize**
This controls the largest single file PHP will accept through a form upload. It affects media uploads in the WordPress Media Library, theme and plugin zip files, and any file upload field in a plugin.

**post_max_size**
This is the maximum size of the entire HTTP POST request, which includes the uploaded file plus any other form data sent at the same time. It must always be at least as large as `upload_max_filesize`, or uploads will fail silently even though the file itself is within the stated limit.

:::warning
Always set `post_max_size` to the same value as `upload_max_filesize`, or larger. If `post_max_size` is smaller, WordPress will appear to accept the upload but the file will never arrive.
:::

## The LVE memory cap: the limit most people miss

Every hosting account on our servers runs inside a CloudLinux LVE (Lightweight Virtual Environment). The LVE sets a hard ceiling on the total memory your entire account can use at any one moment - across all PHP processes, cron jobs, and other scripts running simultaneously.

Think of it this way: `memory_limit` is the size of one cup; the LVE is the size of the jug. You can make each cup as large as you like, but the jug only holds so much. If one cup is filled to the brim, there is less left for every other cup being poured at the same time.

This is the most important thing to understand before raising `memory_limit`. Setting it very high does not give your account more total memory - it just means a single runaway PHP process can consume the whole jug, leaving nothing for other simultaneous requests. The result is often slower performance or errors under load, not better performance.

Your plan's LVE allowance is shown in the Resource Usage section of cPanel. You can also [check your resource usage in detail](/knowledgebase/cpanel-account/understanding-resource-usage-in-cpanel) to see how close you are to your limits at any given time. If you are unsure what your plan allows, contact our support team.

For a broader explanation of how CloudLinux isolates accounts and manages resources, see our [CloudLinux overview](/knowledgebase/dev-server/cloudlinux-overview-why-use-cloudlinux-on-your-server).

## OPcache and apparent memory usage

If your site appears to be consuming more PHP memory than you would expect, one possible cause is OPcache being disabled. OPcache speeds up PHP by storing compiled bytecode in memory so the server does not have to recompile scripts on every request. When it is working normally, it reduces both execution time and the memory overhead of each PHP process. If OPcache is disabled for any reason, PHP has to recompile every script from scratch on each request, which can make memory usage look artificially high.

OPcache is enabled by default on our servers, so this is rarely an issue in practice. However, if you have recently changed PHP versions or extensions, it is worth checking that OPcache is still active. For more detail on what OPcache does and how to verify it is running, see [what is OPcache and how can it be controlled?](/knowledgebase/perf-speed/what-is-opcache-and-how-can-it-be-controlled)

## Recommended values for typical WordPress sites

The table below gives sensible starting points for most WordPress installations. These are not hard rules - match the values to what your site actually needs.

| Setting | Typical starting value | When a higher value is justified |
|---|---|---|
| `memory_limit` | 256M | WooCommerce with many products or extensions, heavy page builders such as Elementor or Divi, bulk import plugins |
| `max_execution_time` | 120 | Bulk CSV imports, WooCommerce order exports, large database operations |
| `upload_max_filesize` | 64M | High-resolution photography sites, video uploads, large theme or plugin zips |
| `post_max_size` | 64M (match or exceed `upload_max_filesize`) | Same as above |

Higher is not always better. A `memory_limit` of 512M or more is rarely necessary on a standard WordPress site, and setting it that high reduces the headroom available for other simultaneous requests within your LVE allowance. Start conservatively and increase only if you see a specific error that points to the limit being hit.

## How to check and change the settings in cPanel

On Kualo servers, PHP settings are managed through the CloudLinux PHP Selector, which appears in cPanel as **Select PHP Version**. This is the correct tool to use - do not look for a MultiPHP INI Editor, as we do not use that on our stack.

1. Log in to cPanel and search for **Select PHP Version**, or find it in the Software section.
2. On the main screen you will see your current PHP version. Click the **Options** or **Settings** tab (the exact label may vary slightly between interface versions).
3. You will see a list of PHP directives with their current values. Find `memory_limit`, `max_execution_time`, `upload_max_filesize`, and `post_max_size`.
4. Click the value you want to change, enter the new value in the correct format (for example `256M` or `120`), and save.
5. The change takes effect immediately for new PHP processes.

For a full walkthrough of the Select PHP Version tool, including how to switch PHP versions and manage extensions, see [how to manage the PHP version in cPanel using the Select PHP Version tool](/knowledgebase/cpanel-php/how-to-manage-the-php-version-in-cpanel-using-the-select-php-version-tool).

:::info
Do not use `define('WP_MEMORY_LIMIT', '256M')` in `wp-config.php` as your primary method of raising memory. On Kualo, the PHP Selector is the authoritative place to set `memory_limit`. A value in `wp-config.php` cannot exceed the PHP-level `memory_limit` anyway, so if the PHP Selector value is already lower, the `wp-config.php` line will have no effect.
:::

## How to confirm WordPress is seeing the new values

After making a change, it is worth verifying that WordPress is actually picking up the new settings rather than reading a cached or overridden value.

1. In your WordPress dashboard, go to **Tools > Site Health**.
2. Click the **Info** tab.
3. Expand the **Server** section.
4. Look for the PHP memory limit, max upload size, and max execution time entries.

If the values shown do not match what you set in the PHP Selector, check that you saved the change correctly and that no plugin or `wp-config.php` entry is overriding them downward.

## When to contact us

If you have set sensible values and WordPress is still hitting memory or timeout limits, the underlying LVE allowance for your account may need to be increased. That is a server-level change you cannot make yourself.

For a short-term fix, you can use the Resource Boost feature in cPanel to temporarily increase your account's resource limits for up to 72 hours per month at no extra cost. See [how to use resource boosts in cPanel](/knowledgebase/cpanel-account/how-to-use-resource-boosts-in-cpanel) for full instructions.

If you need a permanent increase, upgrading to a higher-tier plan gives you a larger LVE allowance as standard. Resellers can also apply a permanent resource boost to individual resold accounts - see [understanding permanent resource boosts for resold accounts](/knowledgebase/reseller/understanding-permanent-resource-boosts-for-resold-accounts) for details.

If you are unsure which option is right for your situation, [raise a support ticket](/knowledgebase/getting-started/how-to-create-a-support-ticket-in-mykualo) and we will advise you.

---

_Source: Kualo Knowledgebase — https://www.kualo.com/knowledgebase/wordpress-optimisation/optimising-wordpress-php-settings-for-performance · © Kualo Ltd._
