Website support, maintenance and fixes for UK businessesCall 0208 088 8371info@websupportservices.co.uk

HomeWordPress errorsFix the WordPress upload_max_filesize Error

Fix the WordPress upload_max_filesize Error

The message "The uploaded file exceeds the upload_max_filesize directive in php.ini" means PHP rejected the file because it is larger than the server's configured per file upload limit. The fix is to confirm the active limit and change the server setting only if a larger upload is genuinely required.

The message you might see

The uploaded file exceeds the upload_max_filesize directive in php.ini.

Different wording, or a file path in the message? Paste it into our free error finder to see which plugin or theme it comes from.

What the upload_max_filesize error means

upload_max_filesize is a PHP configuration directive that limits the size of an individual uploaded file. PHP reports this condition as UPLOAD_ERR_INI_SIZE.

WordPress cannot override a lower limit imposed by PHP after the request reaches the server. The Media Add New screen normally shows the maximum upload size exposed by the hosting environment, which gives you a useful first check before attempting a large theme, plugin, image or other permitted media upload.

There is a second PHP limit to consider. post_max_size controls the size of the complete POST request and should be larger than upload_max_filesize. Raising only the file limit can therefore leave the upload blocked by the overall request limit.

Why WordPress upload size limits vary

The limit is controlled primarily by the PHP configuration used by your hosting environment. Shared hosting, managed WordPress platforms, virtual servers and local development environments can expose these settings in different places.

You may have access through a hosting control panel, a site specific PHP configuration or php.ini. On managed hosting, the provider may deliberately control the maximum and require the change to be made through its own settings.

Do not assume a code snippet found for another server will work on yours. For example, Apache directives placed in .htaccess are not a portable way to change PHP configuration and can trigger a server error where that configuration method is unsupported. Changing the active PHP settings through the host or the correct PHP configuration is safer.

How to increase the WordPress upload size safely

  1. Take a full backup of the website files and database before changing PHP or server configuration.
  2. Check the limit displayed under Media, Add New. Confirm that the file genuinely exceeds it. If an oversized image can simply be resized or compressed before upload, that is often preferable to increasing a server wide limit.
  3. Use your hosting control panel's PHP settings if it provides them. Set upload_max_filesize to a sensible value for the files the site actually needs.
  4. Set post_max_size higher than upload_max_filesize. PHP's documentation specifically requires the POST limit to be large enough for the upload request.
  5. If your server uses a site controlled php.ini, the relevant configuration can look like:
    upload_max_filesize = 64M
    post_max_size = 72M
    The exact values are examples, not requirements. Avoid setting unnecessarily large limits.
  6. Confirm that the change applies to the PHP version and process serving the website. Some hosting platforms use separate PHP configuration for different sites or versions, so editing an inactive php.ini has no effect.
  7. Retest the upload. If the displayed WordPress limit has not changed, check your host's PHP configuration documentation or ask the host which configuration file is active.

WP_MEMORY_LIMIT is a different setting. Increasing WordPress memory does not by itself increase PHP's upload limit.

When to get help with PHP upload limits

Get help if PHP settings revert after you change them, the hosting panel shows one value while WordPress reports another, or you do not control the active PHP configuration. It is also worth investigating rather than raising limits repeatedly if only one plugin, import process or unusually large file requires them.

For production sites, upload limits should be high enough for legitimate administration without accepting arbitrarily large requests. PHP also notes that other settings, including post_max_size, memory and input timing, can affect large uploads.

Web Support Services offers an Emergency Fix for £249 per incident with a response within 2 working hours. Care plans start from £59 a month for ongoing website support.

Common questions

Answers to the questions we hear most about this.

Where do I see the current WordPress upload limit?

Open Media, Add New in WordPress. The maximum upload size reported by the hosting environment is normally shown on that screen.

Should post_max_size be higher than upload_max_filesize?

Yes. PHP states that post_max_size must be larger than upload_max_filesize because the POST limit applies to the complete request, not only the uploaded file.

Can I increase upload_max_filesize in wp-config.php?

Do not rely on wp-config.php for this PHP configuration limit. Change the active PHP configuration using the method supported by your host, such as its PHP settings panel or the applicable php.ini configuration.

Site down or showing an error?

Call us now. Emergency Fix is £149 with a response within 2 working hours, and no fix means no fee.

Get website support