Trying to upload something to your WordPress site but to be met with a bulletin saying "the uploaded file exceeds the upload_max_filesize directive in php.ini"?

This fault message can appear when you lot're uploading big images, videos, plugins, themes, whatsoever blazon of file that you upload to your WordPress site.

In this article, we're going to help you set the problem and go far so that you tin can upload those big files. In total, we'll encompass:

  • What causes the uploaded file exceeds the upload_max_filesize directive in php.ini
  • How to set up the uploaded file exceeds the upload_max_filesize directive in php.ini

What Causes the uploaded file exceeds the upload_max_filesize directive in php.ini

An example of the uploaded file exceeds the upload_max_filesize directive in php.ini
An instance of the uploaded file exceeds the upload_max_filesize directive in php.ini

Let'southward start at the beginning. In society to preserve your server's resources, hosts set a limit on the maximum size of a file that can exist uploaded.

This maximum, in megabytes, is divers in the upload_max_filesize directive.

The upload_max_filesize directive itself is located in the php.ini file, which is the default server configuration file for applications that require PHP.

Those two things – upload_max_filesize and php.ini – are what the error message y'all see is referencing.

It'southward important to remember that this upload limit is not a WordPress setting. However, you lot can see this limit in your WordPress site if you go to Media → Add together New:

How to check upload limit in WordPress
How to check upload limit in WordPress

As yous tin see above, Kinsta sets the default limit at 128 MB, which is quite big and unlikely to ever cause problems. However, a lot of other hosts ready the default as pocket-sized as but 2 MB or iv MB.

That ways if you try to upload a file larger than that limit, yous're going to see the "the uploaded file exceeds the upload_max_filesize directive in php.ini", or a similar message like "file_name exceeds the maximum upload size for this site."

How to Gear up the uploaded file exceeds the upload_max_filesize directive in php.ini

In order to set up this error, you need to increase the file size upload limit. That is, you need to increase the value of the upload_max_filesize directive in your php.ini file.

At that place are several different means you can do this – the exact method that you lot choose volition depend on your preference and your host's configuration.

ane. Talk to your host'southward support

While we'll cover some methods that y'all tin can attempt by yourself, the simplest solution is unremarkably to just attain out to your host's support and ask them to increment the limit for you.

This is a common asking, your host'due south support should know exactly what you desire, and it should simply take a couple of minutes of your time. That's what your host's support is there for!

If you host at Kinsta and need to increase your limit beyond the default 128 MB limit, you lot can accomplish out to support on Intercom from anywhere in your Kinsta dashboard:

Kinsta 24x7 support
WordPress host support

2. Edit php.ini via cPanel

If your host uses cPanel, you should be able to edit your php.ini file and upload_max_filesize directive via the cPanel dashboard.

Starting time, look for the MultiPHP INI Editor:

The MultiPHP INI Editor in cPanel
The MultiPHP INI Editor in cPanel

And then choose your WordPress site from the drop-downwards. After that, you'll exist able to edit the upload_max_filesize directive for that site:

Subscribe Now

Changing the upload_max_filesize directive in cPanel
Changing the upload_max_filesize directive in cPanel

Increase the value based on your needs.

three. Create or edit php.ini via FTP

As you learned above, the php.ini file controls how your server works for PHP applications.

Unfortunately, based on your host's restrictions, y'all may or may not be able to utilise php.ini files. For that reason, a more than reliable approach can sometimes be to use .htaccess (which we'll cover in the next section).

However, you lot can give this a attempt get-go to run into if you are allowed to utilize php.ini at your host.

To get started, connect to your server via FTP and go to your site's root folder.

If y'all already run into a php.ini file in the root folder, y'all tin edit that file. Otherwise, create a new file and name information technology php.ini:

How to create a new php.ini file
How to create a new php.ini file

Then add or modify the code snippet beneath:

  • If y'all created a new file, paste in the lawmaking snippet and modify the numbers to suit your needs.
  • If you're editing an existing file, find the same directives in the existing file and modify the numbers to suit your needs.

upload_max_filesize = 12M
post_max_size = 13M
memory_limit = 15M

Adding the code to the php.ini file
Adding the code to the php.ini file

Some hosts might farther require you to add the suPHP directive in your site's .htaccess file in order for the changes in a higher place to actually piece of work.

To do this, you can also edit your .htaccess file via PHP and add the post-obit lawmaking near the top of the file:

<IfModule mod_suphp.c>
suPHP_ConfigPath /home/yourusername/public_html
</IfModule>

Brand certain to replace yourusername with the actual file path of your site.

four. Increase upload_max_filesize value by editing .htaccess

If direct creating or editing the php.ini file via the methods higher up didn't work, yous can also try to modify the upload_max_filesize directive past editing your site'southward .htaccess file.

To become started, connect to your site via FTP and edit the .htaccess file that'south located in your site's root folder.

Then, add the post-obit code snippet, making sure to adjust the values based on your needs:

php_value upload_max_filesize 12M
php_value post_max_size 13M
php_value memory_limit 15M

How to control php.ini file via .htaccess
How to control php.ini file via .htaccess

If you lot get an internal server error message after adding this code snippet, your server is likely running PHP in CGI mode, which ways yous cannot use these commands in your .htaccess file. Remove the snippets you just added and your site should start operation once more.

Note – if you're a Kinsta customer, Kinsta uses NGINX, which ways your site does non have an .htaccess file. If y'all need assist at Kinsta, nosotros recommend just reaching out to our support team and they'll be able to quickly go things working for you.

Summary

To check if your changes are working, y'all tin can go back to Media → Add New in your WordPress dashboard to see if the new maximum upload limit matches the number yous set up in your php.ini file. If all goes well, you should meet your new value and yous'll be able to upload the file that was giving you bug.

Finally, if cipher y'all've tried is working and your host's support can't help for some reason, you can e'er upload the file via FTP as a workaround. FTP has no limits and will allow you upload everything from images to plugins and themes. You tin can even bulk upload files if needed.


Save time, costs and maximize site functioning with:

  • Instant assist from WordPress hosting experts, 24/vii.
  • Cloudflare Enterprise integration.
  • Global audience accomplish with 29 data centers worldwide.
  • Optimization with our congenital-in Application Performance Monitoring.

All of that and much more than, in one plan with no long-term contracts, assisted migrations, and a thirty-day-money-back-guarantee. Check out our plans or talk to sales to find the program that's correct for you.