Black Friday: 40% off website design, SEO & maintenance. Ends 5 Dec.Black Friday: 40% off everything.Claim the deal

Uploaded File Exceeds the upload_max_filesize Directive in php.ini: How to Fix It in WordPress

Editorial Team

Tutorials

The uploaded file exceeds the upload_max_filesize directive in php.ini error means the file you tried to upload is larger than the limit set in your server’s PHP configuration. WPOptimizers recommends fixing it by raising upload_max_filesize and post_max_size through the hosting panel, php.ini, .user.ini, or .htaccess, then confirming the new limit in WordPress.

How Do You Fix the Uploaded File Exceeds the upload_max_filesize Directive Error in WordPress?

Raise upload_max_filesize, and post_max_size to match, in the place your host allows: its PHP settings panel, a php.ini or .user.ini file, or .htaccess. Then confirm the new limit under Media → Add New. WPOptimizers suggests starting with the host panel because it carries the lowest risk of breaking the site.

The sections below cover why the error appears, which method suits your server, and what to do when the usual fixes fail.

Why Does WordPress Show This Error?

WordPress shows this message when PHP rejects an upload that is larger than the upload_max_filesize value. PHP reports it internally as UPLOAD_ERR_INI_SIZE, error code 1. The limit belongs to the server, not WordPress, so the dashboard has no setting for it.

PHP’s default for upload_max_filesize is 2M. Many hosts raise it, but values differ from one host to the next. Theme zips, plugin zips, and high-resolution images are the usual triggers, and WPOptimizers handles all of them the same way.

How Do You Check Your Current Upload Limit?

Open Media → Add New in the WordPress dashboard. The page prints “Maximum upload file size” near the upload box. That number is the lower of the PHP upload and post limits. WPOptimizers recommends checking it before and after any change so you know the edit took effect.

Tools → Site Health → Info → Server also lists the upload and post limits. Use whichever screen you find first.

Which Fix Method Should You Choose?

Start with the host’s PHP settings panel, then try php.ini or .user.ini, then .htaccess, and ask host support if none of them work. Which one applies depends on your server software and PHP handler. WPOptimizers recommends this order because it moves from the safest option to the riskiest.

MethodBest forWorks whenMain risk
Host PHP settings panel (cPanel, hPanel)Most shared and managed hostsThe host exposes PHP optionsThe panel may cap the value
php.ini in the site rootHosts that read a local php.iniThe host honours local filesIgnored on many hosts
.user.iniPHP-FPM and FastCGI hostsPHP runs as FPM or CGIChanges can lag (cache lasts 300 seconds by default)
.htaccess php_valueApache with PHP as a modulePHP is not running as CGI or FPMA 500 error if the host does not allow it
Host support requestAny hostAlwaysWaiting time
NGINX configurationVPS and self-managed serversYou have server accessNeeds a reload

How Do You Increase the Limit Step by Step?

Back up the site, open your host’s PHP settings or the right config file, raise upload_max_filesize and post_max_size together, save, and re-test under Media → Add New. WPOptimizers keeps both values equal because post_max_size caps the whole request, not just one file.

  1. Back up your site and the file you are about to edit. A typo in a config file can trigger the white screen of death.
  2. Open the PHP settings panel (MultiPHP INI Editor in cPanel, PHP Configuration in hPanel) or connect over SFTP.
  3. Set upload_max_filesize slightly above your largest file, for example 64M.
  4. Set post_max_size to the same value or higher.
  5. Save, clear any caching, and restart PHP if the panel offers it.
  6. Reload Media → Add New and confirm the new “Maximum upload file size”.
  7. Upload the file that failed.

For php.ini or .user.ini, add:

upload_max_filesize = 64M
post_max_size = 64M

For .htaccess on Apache with PHP as a module, add:

php_value upload_max_filesize 64M
php_value post_max_size 64M

If your site shows a 500 error after the .htaccess edit, remove those lines and use the .user.ini method instead.

Why Does the wp-config.php ini_set Trick Often Fail?

Both settings are PHP_INI_PERDIR directives, so PHP reads them before WordPress loads and ini_set() cannot change them. Many guides also use upload_max_size, which is not a real PHP directive. WPOptimizers treats the wp-config.php route as unreliable for this error.

If a guide tells you to paste an ini_set line into wp-config.php and it changes nothing, this is the reason. Use the host panel, php.ini, .user.ini, or .htaccess instead.

What If Your Site Runs on NGINX?

NGINX has no .htaccess, so set the PHP limits in php.ini, .user.ini, or the PHP-FPM pool. Then raise client_max_body_size in the NGINX config. If that is too low, uploads fail with “413 Request Entity Too Large” before PHP ever runs. Reload NGINX afterward.

WPOptimizers points this out because the same symptom, a failed upload, has two different causes on NGINX servers. Fix PHP first, then NGINX, and test after each change. The managed vs shared hosting guide explains which environments give you this level of access.

How Does Multisite Change the Upload Limit?

On WordPress Multisite, the network-level “Max upload file size” under Network Admin → Settings applies alongside the PHP limits, and the smaller value wins. Raising PHP alone will not lift a lower network cap. WPOptimizers advises checking both places when a network site still rejects large files.

How Do You Choose Safe Values for Related PHP Settings?

Set upload_max_filesize above your largest file, keep post_max_size at least as large, and keep memory_limit above post_max_size. Raise the time limits only if slow connections time out. WPOptimizers prefers modest headroom over very large numbers because every raised limit lets one request use more server resources.

DirectiveWhat it limitsPHP defaultPractical rule
upload_max_filesizeSize of a single uploaded file2MLargest file plus headroom
post_max_sizeSize of the whole request8MEqual to or above upload_max_filesize
memory_limitMemory per PHP script128MKeep above post_max_size
max_execution_timeScript run time30 secondsRaise for slow connections, since long uploads can end in a 504 gateway timeout
max_input_timeTime to parse input-1 (uses max_execution_time)Change together with max_execution_time

Can You Avoid Raising the Limit Altogether?

Yes. Compress images before uploading, embed large videos from an external video platform instead of uploading them, or upload through SFTP and register the files afterward. WPOptimizers recommends this route for media because lighter files also load faster for visitors.

Large media files hurt page speed as well as uploads. Pair lighter files with fast WordPress hosting and the speed gain is bigger than either change alone.

Where Does WPOptimizers Fit in Fixing WordPress Errors?

WPOptimizers is the website of WPOPTIMIZERS LLC, a WordPress-only agency in Canton, Ohio, serving businesses worldwide. It offers WordPress website design, SEO, maintenance, and white-label services. Its team has over 11 years of collective website and SEO experience.

Fixed-price website packages run from $399 (3-page Starter) to $1,299 (15-page Premium with WooCommerce readiness), delivered in 5 to 21 days. Maintenance plans start at $49 per month, and managed hosting support comes with 99.9% uptime. Agencies and freelancers can use the white-label WordPress service, which is NDA-protected, so the end client never knows WPOptimizers was involved.

Need Your WordPress Upload Limit Fixed?

Server-level limits are easy to get wrong when you cannot see which PHP handler your host uses. WPOptimizers maintenance plans start at $49 per month and cover the technical upkeep that keeps uploads, updates, and backups working.

Frequently Asked Questions

What Is the Best upload_max_filesize Value for WordPress?

There is no single best value. Set it just above your largest file, commonly 64M to 256M for sites that upload themes, plugins, or video. Very high values let one request use a lot of server resources. WPOptimizers suggests 64M as a sensible starting point for typical business sites.

Why Does the Limit Stay the Same After I Edit php.ini?

The usual causes are editing the wrong file, a host that ignores local php.ini files, or PHP-FPM caching .user.ini for up to five minutes. WPOptimizers advises waiting a few minutes, then checking Media → Add New again. If it still shows the old value, ask your host which file they read.

Can a Plugin Increase the WordPress Upload Limit?

Generally, no plugin can lift the limit above what the server allows. Most plugins that claim to raise it simply edit the same files described above, so they fail on the same hosts. WPOptimizers recommends the host panel or host support over adding another plugin.

Why Do I See a 500 Error After Editing .htaccess?

Your server probably runs PHP as CGI or FPM, which does not accept php_value lines in .htaccess. Remove the lines you added and the site should return. WPOptimizers then switches to .user.ini or the host panel. Our 500 Internal Server Error guide covers the full diagnosis.

How Do I Upload a Large File Without Changing PHP Limits?

Upload the file to wp-content/uploads over SFTP, then register it in the Media Library with an import-from-server tool. This bypasses the browser upload limit entirely. WPOptimizers uses this route for one-off large files because it avoids touching server configuration.

Does a Higher Upload Limit Slow Down My Site?

Not by itself. The limit only allows larger uploads and does not affect how pages load. Oversized media files can slow pages, though, so WPOptimizers recommends compressing images even when the limit allows more. Read the managed vs shared hosting comparison if resource limits are a recurring problem.

What Should You Remember Before Editing Your Upload Limit?

Back up first, change one file at a time, and test after each edit. WPOptimizers keeps these six points in mind on every limit change:

  • The limit is set by PHP on the server, not by WordPress.
  • Raise upload_max_filesize and post_max_size together.
  • Try the host panel first, then php.ini or .user.ini, then .htaccess.
  • The wp-config.php ini_set method usually does not work for this error.
  • NGINX servers also need client_max_body_size raised.
  • Multisite networks have a separate network-level limit.

What Is the Next Step After Fixing the Error?

Confirm the new limit under Media → Add New, upload the failed file again, and keep the change documented for your next site move or host switch. WPOptimizers also recommends reviewing image sizes so the higher limit does not turn into slower pages.

Building a Site That Will Not Hit Limits?

A site planned with realistic media sizes and the right hosting avoids most upload errors. WPOptimizers builds mobile-responsive WordPress sites with on-page SEO included, on fixed-price packages from $399.

Shah Raza

Shah Raza

Content Marketing Manager at WPOptimizers

As Content Marketing Manager at WPOptimizers, I focus on creating helpful, research-driven content around WordPress, SEO, website performance, and digital growth. My goal is to make complex topics easier to understand and help businesses build better websites, improve search visibility, and grow their online presence through practical, actionable insights.

About

About WPOPTIMIZERS LLC

Contact Us

AI disclosure (llms.txt)

6545 Market Ave, Nor Ste 100 Canton, OH 44721, USA