WordPress

Increase PHP upload size, memory and execution time for WordPress

Raise PHP limits for WordPress in cPanel: upload_max_filesize, post_max_size, memory_limit, max_execution_time and max_input_vars, and check they took effect.

BeginnercPanel hosting3 min read

Messages such as "The uploaded file exceeds the upload_max_filesize directive", "Allowed memory size exhausted" or a theme demo import that stops halfway all point to PHP limits. On MdmHost you change these yourself in cPanel, per PHP version, without editing server files.

Before you start

  • Know which PHP version the site uses. It is shown in WordPress → Tools → Site Health → Info → Server.
  • Decide reasonable values. Bigger is not always better: very high limits let one broken script use more of your account's resources.

The settings that matter

DirectiveTypical WordPress valueWhat it controls
upload_max_filesize64MLargest single uploaded file
post_max_size64M or moreTotal size of a form post, must be at least the upload size
memory_limit256MMemory one PHP request may use
max_execution_time120Seconds a script may run
max_input_time120Seconds allowed to receive input
max_input_vars3000Form fields per request; large menus and page builders need more

Change limits with Select PHP Version

  1. Log in to cPanel from MdmHost dashboard → Services.
  2. Open cPanel → Software → Select PHP Version.
  3. Click the Options tab.
  4. Click the value next to each directive and choose a new one from the list. Changes save automatically.

These settings apply to the PHP version selected for the account. If you later switch versions, check the options again.

Change limits with MultiPHP INI Editor

If your site uses a version managed by MultiPHP Manager, open cPanel → Software → MultiPHP INI Editor, choose Basic Mode, select the domain's location and edit the values, then click Apply. In Editor Mode you can add directives that are not listed.

Set the WordPress memory limit

WordPress has its own memory setting that can be lower than PHP's. Add to wp-config.php:

define( 'WP_MEMORY_LIMIT', '256M' );

WordPress cannot use more than PHP's memory_limit, so change both.

Check the change worked

  1. Go to WordPress → Media → Add New. The "Maximum upload file size" line should show the new value.
  2. Open Tools → Site Health → Info → Server and check the PHP memory limit, max execution time and max input variables.
  3. Purge the LiteSpeed cache if an old value is still displayed.

Troubleshooting

  • Value does not change: an old php.ini or .user.ini in the site folder overrides it, or .htaccess contains php_value lines. Remove them and use cPanel instead.
  • 500 error after editing .htaccess: php_value lines are not supported on this setup. Delete them.
  • Uploads still fail on large videos: upload through File Manager or FTP and use a plugin such as Add From Server, or host video on a streaming service.
  • Imports still time out: run them with WP-CLI over SSH, which is not limited by web timeouts.

Limits you cannot raise yourself

PHP settings live inside the account's CloudLinux limits for CPU, memory and processes. Raising memory_limit to a value larger than the account's total memory allowance does not help: the process is stopped when the account limit is reached. If cPanel → Metrics → Resource Usage shows frequent faults, optimise the site (caching, fewer plugins) or ask support which plan fits the workload.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.