The hosts of your site can set any upload file size limit. Hosts do this to preserve the resources of the website. You might have tried uploading something on your WordPress site, but you ended up reading something like “The Uploaded File Exceeds The Upload_Max_Filesize Directive in PHP.ini.” this.
It appears because your host might have set a limit, but the size of the file you are trying to upload extends the limit that your host has already set. Thus, this kind of error appears when you try to upload large videos, images, plugins, themes, or any file on your WordPress site.
But you can easily change the limit of the upload file size of your site according to your convenience and upload the file accordingly. Many users think it’s challenging to adjust the size of the upload file size limit of their website and end up reducing the size of their own file. And this reduces the quality of the file.
But this issue can be resolved quickly if you apply the steps of the methods carefully. These methods will help you to change the value of the file size set by your host, and hence you can upload any size of the file.
So here we’ll help you to fix The Uploaded File Exceeds The Upload_Max_Filesize Directive in PHP.ini. error, so while uploading any file, you don’t face any problem.
What Are The Reasons Behind The Uploaded File Exceeds The Upload_Max_Filesize Directive in PHP.ini. Error?
So, your host sets a maximum file size, which you can upload, in order to preserve the server’s resources. And the maximum size of the file, which is in megabytes, is determined in the upload_max_filesize directive.
There are applications that require PHP, and upload_max_filesize directive, which is located in the php.ini file, is the default server configuration file for those applications.
And also, many users think that this limit is a WordPress setting, but that’s not true. It’s your host who sets the limit, not WordPress. But you can easily check the limit in your WordPress site.
(Click MEDIA and then ADD NEW)
A lot of hosts set the limit as 2 MB or 4MB, which means that you cannot upload a file on the site if its limit extends more than that. And if you try to do so, “the uploaded file exceeds the upload_max_filesize directive in php.ini” will pop up on the screen or the page.
How to Fix The Uploaded File Exceeds The Upload_Max_Filesize Directive in PHP.ini. Error
Solution 1: Edit PHP.ini Via cPanel
To go with this method, you have to make sure that your host company uses cPanel. You can edit your php.ini file only if your company uses cPanel. Also, the upload_max_filesize directive is to be edited with the help of cPanel’s dashboard. So, in short, before starting this method, check whether your host company uses cPanel.
After this step, follow the following steps:
Step 1: First, search for MultiPHP INI Editor in cPanel. Then from the dropdown, choose your WordPress file.
Step 2: Now, you can easily edit your upload_max_filesize directive for your site.
Step 3: Increase the value as per your requirement.
Solution 2: Increase Upload_Max_Filesize Value By Editing .htaccess
In the previous method, you tried creating or editing the php.ini file. But if that doesn’t work, then you can go for this method. In this method, by editing the site’s .htaccess file, you can try to modify the upload_max_filesize directive.
Step 1: Connect your site via FTP.
Step 2: Now, edit the .htaccess file, which you’ll find in your site’s root folder.
Step 3: Now according to your needs, change the values, and then add this whole c
php_value upload_max_filesize 12M
php_value post_max_size 13M
php_value memory_limit 15M
So, there are chances where you’ll get an internal server error message immediately after you add this snippet. Which means your server is most probably running PHP in CGI mode.
That is, these commands cannot be used in your .htaccess file. Now, remove all the snippets completely, and check. Your site must have started functioning.
Solution 3: Take It To Your Host
The easiest way to fix this issue is to talk to your host’s support, and you can ask them to increase the limit for you. Contact your host company directly or through the mail. If you are contacting directly, then show them the error message and propose a request to increase the limit of upload_max_filesize. And if you are contacting through the mail, then take a screenshot of the error message and mail them with writing your problem with the proposed solution.
- ERR_EMPTY_RESPONSE or No Data Received
- Outlook Keeps Asking for Password
- Windows has detected An IP Address Conflict
- Potential Windows Update Database Error Detected
- Rats! WebGL hit a snag
In your WordPress dashboard, go to Media → Add new; there you’ll, you can check all the changes that you’ve done and whether it’s working or not. Also, check whether the new maximum upload limit matches the number that you’ve set in you php.in file.
Every method is explained in detailed steps. Therefore, you should not face any problem regarding any step given in each method. Also, try and apply every method before jumping on to the next one.
If you’ve tried every possible method for the issue and nothing is working in your favor, not even the host’s support, then you can also upload the file via FTP. Uploading the file via FTP is the only possible solution after trying every possible method. FTP helps you to upload any kind of file, from images to plugins and also the themes. And if you have a bulk of files to upload on your site, FTP can help you with that as well.