Increase upload_max_filesize, memory_limit and max_execution_time in cPanel - ShoHost guide

Increase upload_max_filesize, memory_limit and max_execution_time in cPanel

Tested in a ShoHost sandbox on 12 October 2026: Apache 2.4.68 and PHP 8.4.26 (mod_php) on Debian, captured with headless Chrome. We uploaded a 3 MB and a 9 MB test file against the default limits, then raised the limits. The sandbox runs PHP as an Apache module, so we raised them with php_value lines; on cPanel you’d normally use MultiPHP INI Editor, whose screen isn’t shown because the sandbox has no cPanel. Every screenshot below is from that sandbox or from a public DNS lookup, not from a customer site.

Uploads that fail with “The uploaded file exceeds the upload_max_filesize directive in php.ini”, imports that stop halfway, and Allowed memory size exhausted errors all come from PHP limits. On cPanel hosting you can raise them yourself, up to whatever maximum your host allows.

The settings that matter

Sandbox page showing default PHP limits: upload_max_filesize 2M, post_max_size 8M, memory_limit 128M, max_execution_time 30
The default PHP limits in our sandbox.
  • upload_max_filesize: the largest single file PHP will accept.
  • post_max_size: the largest whole form submission. Keep it equal to or larger than upload_max_filesize.
  • memory_limit: RAM one PHP request may use.
  • max_execution_time: seconds a script may run before PHP stops it.
  • max_input_time and max_input_vars: time to receive input, and the number of form fields (big menus and settings pages hit this one).

What hitting the limit looks like

Upload result showing error code 1 UPLOAD_ERR_INI_SIZE for a 3 MB file
A 3 MB upload against a 2M limit: PHP refuses the file with error code 1.
error_log warning that POST Content-Length exceeds the limit, and the .htaccess override with new values
A 9 MB upload goes over post_max_size, so PHP drops the whole request and logs a warning.

Note the difference. A file over upload_max_filesize arrives with an error code your app can report. A request over post_max_size is dropped completely, so the app sees an empty form and often shows a confusing or blank error. That’s why both values need raising together.

Step 1: Raise them in MultiPHP INI Editor

  1. Open cPanel → Software → MultiPHP INI Editor.
  2. In Basic Mode, choose your domain from the drop-down.
  3. Set upload_max_filesize, post_max_size, memory_limit and max_execution_time. Example: 64M, 64M, 256M, 120.
  4. Click Apply.

On CloudLinux servers, Select PHP Version → Options holds the same settings. Use that one if it exists, since it takes priority.

Step 2: Other ways, if the editor isn’t available

cPanel writes these into a .user.ini or php.ini file in the site folder (for PHP-FPM, CGI or LSAPI). On servers that run PHP as an Apache module, which is what our sandbox does, .htaccess lines work instead:

php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value memory_limit 256M
php_value max_execution_time 120

Don’t put php_value lines in .htaccess on PHP-FPM or LSAPI servers; Apache doesn’t know them there and returns a 500 error. If that happens, remove the lines and use MultiPHP INI Editor.

Step 3: Confirm

Sandbox page showing raised PHP limits: upload_max_filesize 64M, post_max_size 64M, memory_limit 256M, max_execution_time 120
After raising the limits, the same page shows the new values.

Check the values with a phpinfo() page (delete it afterwards), or in WordPress under Tools → Site Health → Info → Server. If a value won’t go above a certain number, that’s your host’s ceiling.

FAQ

Why didn’t my change take effect?

A different file may be winning: a .user.ini in a subfolder, a php.ini from an old host, or CloudLinux’s Select PHP Version options. Check phpinfo’s ‘Loaded Configuration File’ and ‘Additional .ini files’ lines.

How high should I set memory_limit?

Only as high as the app needs. 256M is plenty for most WordPress sites. A very high limit can hide a plugin with a memory leak.

Will a higher max_execution_time fix a 504?

Not if a proxy or CDN in front times out first. See our 504 Gateway Timeout guide.

Need a hand?

Want someone to do this for you? If your site is on ShoHost, message our support team on WhatsApp at +91 94880 91432 or email [email protected] and we’ll adjust the PHP limits with you. Hosting somewhere else and running into PHP limits often? ShoHost WordPress hosting runs on LiteSpeed servers with NVMe storage and free SSL, and includes free migration.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *