How to increase Maximum Upload size in cPanel?

How to increase Maximum Upload size in cPanel?

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

Why .htaccess Fails to Increase Upload Limits in cPanel

When you attempt to increase the maximum upload size for WordPress media uploads on a cPanel server, the immediate reaction is often to edit configuration files. The standard approach involves placing php_value directives inside .htaccess. Based on common search results, developers typically add lines like php_value upload_max_filesize 20M and php_value post_max_size 20M directly into their root directory's .htaccess file.

However, this method is frequently ineffective on shared hosting environments managed by cPanel. If you have already tried placing these directives both inside and outside the standard WordPress rewrite block without success, or if you encounter a 500 Internal Server Error upon doing so, the issue lies in how the server processes .htaccess files relative to PHP configuration.

The root cause is that modern cPanel installations often disable AllowOverride for specific directories or globally restrict access to certain PHP directives via .htaccess. When you insert php_value upload_max_filesize 20M into an .htaccess file, the server may ignore it entirely if the AllowOverride setting for that directory is set to None or All (where None overrides the directive). More critically, many hosting providers explicitly block direct modification of specific PHP memory and upload limits via .htaccess to enforce security policies. Attempting to force these values when the server is configured to reject them often triggers a 500 error because the web server cannot parse the invalid configuration context.

Since cPanel typically does not provide a "PHP Configuration Editor" in the Software section for editing these specific limits, you must utilize the MultiPHP INI Editor tool instead. This interface allows you to modify php.ini settings on a per-directory basis or globally without touching sensitive files directly.

To resolve this, log into your cPanel account and navigate to the Software section, then select MultiPHP INI Editor. You will see a list of installed sites; click the gear icon next to your specific domain to access its configuration. Once inside, scroll down to find the PHP Options tab.

Here is where you must make the changes:

  1. Locate upload_max_filesize and set it to your desired size (e.g., 20M).
  2. Locate post_max_size and set it to a value equal to or slightly higher than your upload_max_filesize. It is crucial that post_max_size is never smaller than upload_max_filesize, or the upload will fail silently due to truncation.
  3. If you are dealing with very large files, consider adjusting max_execution_time and memory_limit as well, as processing large uploads consumes more resources and time.

After making these edits, click Save. The changes usually take effect immediately, but restarting the web server (via Restart Apache or Restart Nginx) ensures the new configuration is loaded cleanly.

Understanding the Trade-offs

While the MultiPHP INI Editor provides granular control, there is a significant trade-off to consider. Changes made here are isolated to your account and cannot be shared across domains without creating separate entries for each site. Furthermore, if your hosting provider manages the global php.ini file strictly, some settings might still be overridden at the server level regardless of what you enter in the editor.

If the MultiPHP INI Editor is unavailable or locked down by your host, and .htaccess modifications yield a 500 error, it indicates that your specific hosting plan restricts these parameters entirely. In such cases, you must contact support to request an increase in the global upload limit. There is no workaround for hard-coded server restrictions without root access.

A Note on Related Technologies

For developers managing their own VPS or dedicated servers where shared hosting constraints do not apply, the configuration path differs significantly. On unmanaged Linux servers with PHP-FPM, you would typically edit the php-fpm.d pool files located in /etc/php*/fpm.d/. Here, you can add upload_max_filesize = 20M and post_max_size = 20M directly to the pool configuration file. However, on cPanel-based shared hosting, this manual file editing is not permitted.

If your application stack requires more complex PHP configurations beyond simple value adjustments—such as integrating with Laravel or other frameworks requiring specific middleware setups—consulting specialized resources like https://laravelcompany.com can provide guidance on optimizing upload handling within framework-specific constraints.

Our network