Skip to content
WordPress3 min read

How to fix "The uploaded file exceeds the upload_max_filesize directive in php.ini"

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

Short answer

"The uploaded file exceeds the upload_max_filesize directive in php.ini" appears when the file you upload to WordPress is larger than PHP's upload limit. Raise both upload_max_filesize and post_max_size in cPanel's MultiPHP INI Editor, or upload the large file directly through File Manager.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. Common causes
  2. How to fix it
  3. Prevention
  4. On ArabyHost

WordPress uploads go through PHP, and PHP rejects any file larger than upload_max_filesize. The Media » Add New screen shows the current limit, e.g. Maximum upload file size: 2 MB; go over it and you get this message, or exceeds the maximum upload size for this site. If the whole request is larger than post_max_size, you may instead see “The link you followed has expired”.

Common causes

  • A low default upload limit compared with theme packages, videos or import files.
  • Only upload_max_filesize was raised, not post_max_size, so the smaller limit still applies.
  • The wrong domain was edited in MultiPHP INI Editor.
  • A Multisite network limit lower than PHP’s.
  • The web server’s own request limit, which usually shows up as a 413 error.

How to fix it

1. Raise the values in MultiPHP INI Editor

  1. In cPanel open Software » MultiPHP INI Editor.
  2. On the Basic Mode tab, choose the site’s domain.
  3. Set the following, then click Apply:
Setting Suggested value Why
upload_max_filesize 128M Size of a single file
post_max_size 128M Size of the whole request; must be at least the above
memory_limit 256M To process the file after upload
max_execution_time 300 So large uploads aren’t cut off
max_input_time 300 Time allowed to receive the file

2. Confirm the new limit

Open Media » Add New and check it now reads Maximum upload file size: 128 MB. You can also look under Tools » Site Health » Info » Server.

3. On Multisite

In Network Admin » Settings, raise Max upload file size, which is a separate limit from PHP’s.

4. Upload large files with File Manager

If the file is bigger than any sensible limit (a full backup, say), open the target folder in Files » File Manager and click Upload:

  • Theme: upload the ZIP to wp-content/themes, click Extract, then activate it in Appearance » Themes.
  • Plugin: upload to wp-content/plugins, extract, then activate it under Plugins.
  • Media file: uploading through File Manager doesn’t add it to the Media Library automatically, but you can use its direct URL.

Avoid php_value in .htaccess

Some tutorials suggest adding php_value upload_max_filesize to .htaccess. That doesn’t work with every PHP handler and can cause a 500 error, so use MultiPHP INI Editor instead.

Prevention

  • Compress images and video before uploading, and use an external video service for very large files.
  • When moving to a new host, check the PHP settings before importing the site.
  • If the large file is a database dump, see phpMyAdmin import file too large.

On ArabyHost

You set upload_max_filesize, post_max_size and the other values per domain in MultiPHP INI Editor in cPanel, opened with one click from the Araby Panel, and choose PHP 8.1 to 8.3. For very large files, File Manager handles direct uploads, and on AI/Developer plans you can also use SSH. If you’re moving a large site, take advantage of our free migration help.

FAQ

What's the difference between upload_max_filesize and post_max_size?

upload_max_filesize caps a single file; post_max_size caps the whole request, including the file and form data. post_max_size must be equal or larger, otherwise the smaller value wins.

I changed the values but the Media page still shows the old limit. Why?

Make sure you edited the right domain in MultiPHP INI Editor, wait a few minutes because some settings are cached, then reload. On Multisite there's an extra limit in Network Settings.

Can I upload a very large file without changing settings?

Yes. Upload it through cPanel's File Manager or FTP, which bypasses WordPress's upload limit. For themes and plugins, upload the ZIP to the right folder and extract it.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.