The uploaded file exceeds the upload_max_filesize directive in php.ini error while uploading plugin

The uploaded file exceeds the upload_max_filesize directive in php.ini error while uploading plugin

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

Stefan Bogdanescu

Founder & Senior Architect

The uploaded file exceeds the upload_max_filesize directive in php.ini error while uploading plugin

When attempting to upload a WordPress plugin via an FTP client or a hosting control panel, you may encounter the error: "The uploaded file exceeds the upload_max_filesize directive in php.ini." This is not an issue with your plugin code or the server's disk space; it is a PHP configuration bottleneck. The upload_max_filesize directive explicitly limits the maximum size of files that can be processed by the PHP upload handler. If your plugin package, often a .zip file, exceeds this limit—commonly set to 2MB on default shared hosting—the request fails immediately before any code validation occurs.

The error message itself points directly to the source: php.ini. However, relying on the default location of this file is a common pitfall. On many modern shared hosting environments or local development setups like WAMP, the active configuration is not the main php.ini in your root directory but rather a separate .ini file referenced by the php_ini directive in the server's global php.ini. Modifying the wrong file will result in no changes taking effect. To fix this, you must identify the actual runtime configuration used by your specific environment.

If you are working locally on WAMP 2.0 or XAMPP, the process involves locating the active PHP configuration file. Open your control panel and navigate to the php or apache settings menu. Look for the "php.ini (extra)" or similar option that allows you to edit the specific file loaded by Apache. Once identified, add or modify the following lines:

upload_max_filesize = 10M
post_max_size = 10M

It is crucial to update both upload_max_filesize and post_max_size. The post_max_size directive defines the maximum size of POST data that a form can send. If you increase upload_max_filesize but leave post_max_size lower, PHP will still reject the upload because the total POST body exceeds the allowed threshold for form submissions. Both values should be set to at least 10MB to accommodate most standard plugin packages.

After saving the configuration file, you cannot simply reload the browser tab; a full server restart is required for these changes to take effect. On WAMP, click the stop/start icon in your system tray and reboot Apache. If you are on a remote Linux server using Nginx, you must also check nginx.conf or the site-specific configuration file, as Nginx handles the initial upload limit before passing the request to PHP. In that scenario, add the following inside the server block:

client_max_body_size 10M;

Restarting Nginx after making this change is equally mandatory. Once the restart is complete, attempt the plugin upload again. The file should now process successfully, allowing the WordPress installation to unzip and activate the new functionality without triggering a PHP error.

There are trade-offs to consider when increasing these limits. While setting them higher solves immediate upload issues for large plugins, it also increases memory consumption during form submission. If your server has limited RAM or is running under heavy load from other processes, excessively high POST sizes could lead to Allowed Memory Size errors on smaller uploads. A 10MB or 20MB limit is generally a safe balance that handles large media libraries and complex plugins without compromising stability for standard operations.

If you continue to face issues despite adjusting these settings, verify that no other directives are overriding your configuration. Sometimes .htaccess files or virtual host configurations can restrict file upload sizes independently of php.ini. Additionally, ensure that the plugin file you are uploading is not corrupted; sometimes a truncated download appears as an oversized file to the server due to incomplete headers.

For enterprise-level deployments or complex hosting environments where manual file editing is restricted, consider using alternative installation methods such as WP-CLI if available, or contacting your hosting provider to request a temporary increase in upload limits during the deployment window.

Our network