Skip to content
Free website migration on every plan, done by our team.Learn more ›
WordPress

How to increase PHP memory, upload size and time limits in cPanel

Raise memory_limit, upload_max_filesize, post_max_size and max_execution_time in cPanel, plus the WordPress setting, with sensible values for most sites.

Short answer: In cPanel, open Select PHP Version → Options or MultiPHP INI Editor, then raise memory_limit, upload_max_filesize, post_max_size and max_execution_time. For WordPress, also set WP_MEMORY_LIMIT in wp-config.php. Stay within your plan's limits.

The settings that matter

SettingWhat it controlsSensible value for most sites
memory_limitMemory one PHP request can use256M
upload_max_filesizeLargest single upload64M
post_max_sizeLargest form submission (must be at least the upload size)64M
max_execution_timeSeconds a script may run120
max_input_varsForm fields per request (big menus need more)3000

Option 1: Select PHP Version

On many cPanel servers you'll find Select PHP Version. Open the Options tab and change the values. They apply immediately.

Option 2: MultiPHP INI Editor

Open MultiPHP INI Editor, choose your domain, change the values in Basic Mode and save.

WordPress memory

WordPress has its own memory setting. Add this line to wp-config.php above the "That's all, stop editing" comment:

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

Check that it worked

In WordPress, open Tools → Site Health → Info → Server to see the active values.

Don't just keep raising limits

If a site needs ever more memory, something is usually wrong: a heavy plugin, a runaway query or too much traffic for the plan. Fix the cause with caching and lighter plugins, or move to a VPS when you've outgrown shared hosting.

Frequently asked questions

Why can't I upload a large file even after raising the limit?

post_max_size must be at least as large as upload_max_filesize. Also check limits in the app itself.

Can I set limits in .htaccess?

Sometimes, but it depends on how PHP runs on the server. The cPanel tools above are the reliable way.

Is there a maximum I can set?

Yes. Your plan's resources cap what's possible. Ask support if you need more.

Ready when you are

Host it where it performs

NVMe speed, offshore privacy and a written SLA — live in minutes on AuroxHost.