PHP limits: memory, time, upload size and the one that fails silently

«I cannot upload the image.» «The import stops halfway.» «The menu lost half its items after saving.» Three different complaints with the same origin: a PHP limit was reached. The good news is that nearly all of them are changed in your own panel, without opening a ticket.

The four that matter, and what each one stops

Limit What happens when it is reached
upload_max_filesize The file will not upload. WordPress says the file exceeds the maximum size. By far the most commonly hit.
post_max_size The whole form fails, or several files at once. It has to be larger than the one above.
memory_limit Blank page or critical error, with Allowed memory size exhausted in the log.
max_execution_time The operation stops halfway without finishing. Typical of imports, backups and migrations.
And there is a fifth nobody knows about, which fails silently. max_input_vars limits how many fields a form may submit — not the size, the count. When it is exceeded, PHP throws the extra fields away without saying anything. It is the explanation for large WordPress menus losing items on save, and for theme option pages that will not keep half the settings. Nobody suspects PHP because no error appears.

PHP's memory limit is not the plan's memory

These get confused a lot, and the difference is simple.

memory_limit The plan's memory
It is per request The ceiling one script may spend at a time.
It is a brake It exists to stop badly written code consuming everything and taking the rest down.
They add up Three visits at once, 100 MB each, is 300 MB of consumption — and none of them hit a 128 MB limit.
It is the account total What the plan gives you overall, shared by everything running.

Hence the conclusion that matters: raising memory_limit does not give you more resources — it only lets each request spend more of what you already have. If the problem is the plan hitting its ceiling, the symptom is different (error 508) and so is the fix: see website errors: 500, 403, 404 and 508 and how to monitor performance in cPanel.

How to change them, without asking anybody

All four are at your disposal in cPanel — you do not need to write to us:

1 Open the PHP Selector and go to the options tab. memory_limit, max_execution_time, post_max_size and upload_max_filesize are there.
2 Alternatively, the MultiPHP INI Editor does the same per domain, and its direct-edit mode lets you add max_input_vars, which does not appear in the basic list.
3 Save and confirm with phpinfo() — see viewing and adjusting your PHP configuration. The value has to appear there; if it does not, it was saved in the wrong place.
4 If it half worked, check the order: memory_limit larger than post_max_size, and that larger than upload_max_filesize. If they are the wrong way round, the smallest wins and the change looks like it did nothing.
Values that solve nearly everything. For a shop or an image-heavy site: upload_max_filesize 64M, post_max_size 128M, memory_limit 256M, max_execution_time 120 and max_input_vars 5000. Do not set enormous numbers «to be safe»: a high limit speeds nothing up and only lets badly written code run longer before it fails.

WordPress has a limit of its own, on top of this

A detail that costs afternoons: even with a generous server memory_limit, WordPress applies its own ceiling. If you still see memory errors after raising the panel's, add this to wp-config.php, above the line telling you to stop editing:

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

The first applies to the site; the second, higher one, only to the admin dashboard, which is where heavy operations run. Neither can exceed the server's limit — they are a ceiling inside another. More on reading these errors in common WordPress errors.

When raising the limit is not the answer

Worth saying, because it saves everyone time: if you are raising the same limit for the third time, the limit is not the problem.

1 An enormous import is done in parts, or from the command line, not by stretching the execution time until it fits.
2 A 40 MB image should not go onto a website. Resize it first — see the site is slow.
3 A plugin needing 512 MB to draw one page has a problem, and the problem is not the server.
4 If the site has genuinely grown, the conversation becomes about the plan — see shared hosting vs VPS.

For what we handle and what stays with the application, see how far our support goes. And before touching wp-config.php or configuration files, make sure you have a copy — how to restore your data with JetBackup.

Raised the limits and it still fails? Send us the error message.

Open a ticket

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from $10.00/mo

See plans
  • 0 Users Found This Useful
Was this answer helpful?