Fix your uploaded file exceeds the upload max filesize directive?

The affects of Web Hosts on Your Business Website

Here're ways your choice of web hosting service provider impacts the performance of your business:


check

Website loading speed

check

Uptime and availability

check

Customer support

check

Security

check

Server location

How to Fix the uploaded file exceeds the upload max filesize directive in php.ini Error

How to Fix the uploaded file exceeds the upload max filesize directive in php.ini Error

VPS Hosting

Overview

When you try to upload a file to your WordPress site, you get a notice that says “The uploaded file exceeds the upload max filesize directive in php.ini.”

When you upload huge images, movies, plugins, themes, or any other form of file to your WordPress site, you may receive this error notice.

We’ll show you how to fix the problem and allow you to upload those enormous files in this article. We’ll cover the following topics in total:

What causes the upload max filesize directive in php.ini to be exceeded?

The upload max filesize directive in php.ini is exceeded by an example of the uploaded file.

Let’s get this party started. Hosts impose a limit on the maximum size of a file that can be uploaded in order to conserve server resources.

The upload max filesize directive specifies the maximum file size in megabytes.

The upload max filesize directive is found in the php.ini file, which is the standard server configuration file for PHP applications.

The error message you’re seeing refers to those two items – upload max filesize and php.ini.

It’s vital to note that this upload limit isn’t controlled by WordPress. However, if you go to Media Add New: Limits on your WordPress site, you may see this limit.

How do I check my WordPress upload limit?

As you can see in the screenshot above, GreggHosting sets the default limit to 128 MB, which is pretty substantial and unlikely to pose any problems. Many other hosts, on the other hand, configure the default to be as modest as 2 MB or 4 MB.

If you try to upload a file that is bigger than that, you’ll get a notice like “the uploaded file exceeds the upload max filesize directive in php.ini” or “file name exceeds the maximum upload size for this site.”

How to Repair the uploaded file exceeds the upload max filesize directive in php.ini

You must increase the file size upload limit to resolve this problem. That is, the value of the upload max filesize directive in your php.ini file must be increased.

You can achieve this in a variety of ways; the one you choose will be based on your preferences and the setup of your host.

1. Speak with your host’s support staff.
While we’ll go over several strategies that you may try on your own, the most straightforward approach is to simply contact your host’s support and request that the limit be increased for you.

This is a frequent request, and your host’s support should be able to provide you with exactly what you need in a matter of minutes. That’s why your host’s assistance is available!

If you’re a GreggHosting host and need to expand your limit beyond the default 128 MB, you can contact support using Intercom from anywhere in your GreggHosting dashboard:

WordPress host support is available 24 hours a day, 7 days a week on GreggHosting Using cPanel, modify the php.ini file.
If your host uses cPanel, you should be able to use the cPanel dashboard to update your php.ini file and upload max filesize directive.

To begin, locate the MultiPHP INI Editor:

The cPanel MultiPHP INI Editor
Then, from the drop-down menu, select your WordPress site. You’ll be able to adjust the upload max filesize directive for that site after that:

Do you want to discover how we grew our traffic by over 1000%?
Join the 20,000+ people who receive our weekly email with WordPress insider secrets!

Now is the time to subscribe.
In cPanel, changing the upload max filesize directive

Increase the value in accordance with your requirements.

3. Using FTP, create or change php.ini
The php.ini file, as you learned before, governs how your server handles PHP applications.

You may or may not be able to use php.ini files, depending on your host’s restrictions. As a result, using.htaccess (which we’ll cover in the next section) can occasionally be a more dependable solution.

However, you can try it out first to see if your server allows you to utilize php.ini.

To begin, connect to your server through FTP and navigate to the root folder of your website.

You can edit the php.ini file if it already exists in the root folder. Otherwise, make a new file with the name php.ini:

How to make a fresh php.ini configuration file

Then add or change the following code snippet:

 

Do you have trouble with downtime with WordPress? GreggHosting is a Web Hosting Service that saves you time! Take a look at our highlights.
If you’re working with a new file, copy the code snippet and change the numbers to fit your needs.
If you’re updating an existing file, look for similar directives and change the numbers to fit your needs.
memory limit = 15M upload max filesize = 12M post max size = 13M

The code is added to the php.ini file.

In order for the modifications above to take effect, certain hosts may require you to include the suPHP directive in your site’s.htaccess file.

You may also achieve this by editing your.htaccess file with PHP and adding the following code at the top:

IfModule mod suphp.c mod suphp.c mod suphp.c mod suphp.c mod s
/home/yourusername/public html suPHP ConfigPath
</IfModule>

Make careful to substitute yourusername with your site’s actual file address.

4. Modify the.htaccess file to increase the upload max filesize value.
If the steps above for creating or updating the php.ini file did not work, you can try modifying the upload max filesize directive in your site’s.htaccess file.

To begin, login to your site through FTP and edit the.htaccess file in the root folder of your site.

Then, add the following code snippet, adjusting the values to suit your needs:

upload max filesize 12M php value
post max size 13M php value
15M php value memory limit

How to use.htaccess to control the php.ini file
If you get an internal server error after adding this code snippet, your server is probably running PHP in CGI mode, which means you won’t be able to use these commands in your.htaccess file. Remove the snippets you just added, and your site should now work properly.

Note that if you’re a GreggHosting customer, your site will not have an.htaccess file because GreggHosting uses NGINX. If you need assistance with GreggHosting , we recommend contacting our support staff, who will be able to swiftly get things up and running for you.

Summary

Return to Media Add New in your WordPress dashboard to test whether the new maximum upload limit matches the number you specified in your php.ini file to determine if your changes are working. If everything works smoothly, you should be able to view your new value and upload the file that was causing you trouble.

Finally, if nothing else works and your host’s support is unable to assist you for whatever reason, you may always upload the file over FTP as a workaround. FTP has no restrictions, allowing you to upload everything from photos to plugins and themes. If necessary, you can also upload files in bulk.

Save time, money, and improve site performance by using:

Expert WordPress hosting assistance is available 24 hours a day, 7 days a week.
Integration with Cloudflare Enterprise.
With 29 data centers across the world, we can reach a global audience.
With our built-in Application Performance Monitoring, you can improve your performance.
All of this and more is included in a single plan that includes no long-term obligations, aided migrations, and a 30-day money-back guarantee. Check out our plans or speak with a sales representative to find the ideal plan for you.