File Upload Exceeds Maximum Size for Client!
Terminal updated - October ix, 2020
So y'all tried uploading that high-resolution video on your WordPress site, or that sizable plugin for that matter. And you are shown an fault that reads like " AmazingVideo.mp4 exceeds the maximum file size for this site ". In PHP, the maximum file treatment size is restricted to a sure limit. Hence to change or increase the size, there are few methods that you lot can try out.
In this article, I'll prove you lot how to increase maximum file upload size in WordPress.
But first, how can you encounter the default upload filesize of your site?
For this, go to Media > Add New from the WordPress sidebar menu.
The default file upload size for PHP is displayed in WordPress as shown in the screenshot beneath. This default file upload size information is stored in php.inifile(which we'll discuss after in this article).

Y'all might have come across several methods for doing this, but here I have listed three ideal approaches to changing the maximum file upload size.
Method 1: Adding lawmaking to.htaccess file
If you have admission to your server, you tin utilise an FTP Client software like Filezilla or Cyberduck to update the .htaccess file.
For this demonstration, I am using FileZilla.
Follow the below steps to update the .htaccess file –
- Open your website directory in Filezilla and locate the .htaccess file.
The Filezilla Client setup explanation is out of the scope of this article, you can refer this commodity for the tutorial.
The settings are as shown in the screenshot below.

Once you have institute the .htaccess file, select the file and correct-click to open up the context menu. Click on View/Edit option.
Open up the file using a text editor(probably Notepad++), and place the following code at the finish of the code.
php_value upload_max_filesize 100MB php_value post_max_size 100MB php_value memory_limit 300MB
The upload_max_filesize variable describes the maximum size for file uploads. The post_max_size variable describes maximum size that will exist handled in a Post request. And memory_limit describes the retentiveness limit for PHP.
You lot tin can define the custom values of your own. Only recall, the memory_limit has to be equal or greater than upload_max_filesize. Hence, make certain you enter the right value.
A sample .htaccess file is as shown in the screenshot below.

As you can see I have increased the file upload size to 100MB from the default 50MB.
Once you have saved the file and return back to your FTP Client software, you'll be asked to upload(or overwrite) the updated file. Click Yeah to proceed further.
A sample screenshot is shown below.

Now go to Media > Add New and reload the page to run into the updated file upload size.

Method 2: Adding lawmaking to php.ini file
This method is the most preferred method for changing the file size and retention for your site. The all-time practice to update php.ini file is again using FTP Customer software.
Search php.ini file in the root directory of your hosting server. This file can be located anywhere depending on your server. But generally, information technology is stored in /etc.
Tip: To locate php.ini file on your server, refer here or this article.
Once you take establish the file, keep with the editing process, as shown in the screenshot beneath.

Add the post-obit code at the bottom of the page.
upload_max_filesize = 100M post_max_size = 100M max_execution = 300
The following screenshot shows the lawmaking added to the php.ini file.

Tip: If y'all want to run across the default file upload size of your site, search "upload_max_filesize" in the file before adding the above code.
Save the file and upload it again to your server. Next, yous need to restart the server to meet the practical settings in the media upload dashboard. Without this, the file size will not be updated in the php.ini file.
Method three: Adding code to Theme Functions
Although you can access Theme Functions ( functions.php) file using FTP Client software(the procedure will be same as the above 2 methods), an easy method is using WordPress dashboard. But you would still need the Write access from the server to edit the theme functions file.
In the WordPress sidebar bill of fare, navigate to Appearance > Editor.
Open the Theme Functions(functions.php)and paste the following code at the lesser department of the page.
ini_set ( 'upload_max_size' , '100M' ); ini_set ( 'post_max-size' , '100M' ); ini_set ( 'max_execution_time' , '300');
Following is a sample screenshot of the code added to functions.php

Final comments
Y'all can increase your file upload size using either of the 3 methods that I have discussed in this article, with the most recommended beingness method two. If whatsoever of the methods don't piece of work for you lot, contact your hosting service provider as a final resort. Although you may stumble upon some plugins that would assist you with this process, I would strongly suggest not to get for it.
Equally yous can see, with footling understanding, y'all yourself could solve the problem. I hope this commodity was helpful enough to increase the maximum file upload size in your WordPress site.
Do allow me know which method worked for you in the comment section. If you lot are nevertheless running into trouble with this topic, ask me in the comment department.
Or check our WordPress troubleshooting article to notice solutions to common WordPress errors.
For other amazing manufactures, continue exploring LearnWoo.
Source: https://learnwoo.com/increase-maximum-file-upload-size-wordpress/
0 Response to "File Upload Exceeds Maximum Size for Client!"
Post a Comment