Exceeds the Maximum Upload Size for This Site Php.ini Is Set

Themeisle content is complimentary. When you purchase through referral links on our site, nosotros earn a commission. Acquire More

Did you merely try to upload a file to your WordPress site only to be met by an error message proverb "the uploaded file exceeds the upload_max_filesize directive in PHP.ini"?

The error occurs when you are trying to upload a large file which tin can be an prototype, plugin, theme, or video. If the file size of the upload exceeds the maximum upload size configuration on your hosting server, you'll see this error bulletin.

The gear up? Edit your server'southward configuration settings to increase the maximum upload filesize.

In this article, we are going to help you resolve this issue past extending the server's default file upload limit.

Don't worry, it's not as hard as it sounds. We volition share four dissimilar methods and you tin choose whichever method you notice comfortable and piece of cake to execute.

📚 Table of contents:

  1. Alter PHP configurations on cPanel
  2. Edit the .htaccess file
  3. Edit the wp-config.php file
  4. Update php.ini via FTP

What causes the "the uploaded file exceeds the upload_max_filesize directive in PHP.Ini" error?

In the introduction, we talked most how your hosting prevents large files like images, videos, plugins, or themes from existence uploaded to the server. They want to ensure that the server resource are being fairly shared among its users. By putting a cap on the file size, they make certain that no single website is using a asymmetric amount of server space or memory.

In WordPress, you tin can check your upload limit by opening the Media Library upload area – Media > Add together New.

maximum upload size on media wordpress
Finding maximum upload size on WordPress

The good news is yous can overcome this hurdle by changing the default limit. However, at that place are risks involved. 1 of the most mutual risks that yous run into is by making the slightest of error in the .htaccess or wp-config file and your entire website would come down crashing.

To safeguard your site from such a nightmare, we recommend taking a backup of your website before trying whatsoever of the tips in this article.

How to fix the "upload_max_filesize" error in WordPress

To upload a large file into your website, all you need to practice is increase the upload limit on your server. We'll share four different methods to achieve this – at least 1 of them should piece of work for your site.

Note: You can adjust the upload limit to the desired value as long equally your hosting provider supports it. If your file size is 10MB and your hosting supports upward to 8MB, and so you'd have to motion to a ameliorate hosting provider.

To discover your PHP memory limit, become to Tools > Site Wellness > Info.

site health in wordpress
Finding PHP memory limit on WordPress

1. Change PHP configurations on cPanel

Let's start with the easiest method, which should work fine as long as your host uses cPanel for the hosting dashboard.

If your hosting provider doesn't offer cPanel, yous tin can try i of the other options on this list.

Here'south how to increment the max upload size in cPanel:

  1. Log into your hosting account.
  2. Open cPanel.
  3. Become to Select PHP Version > PHP Options/Options. Or, in some situations, you might need to look for a tool called MultiPHP INI Editor.
  4. Change the value for upload_max_filesize co-ordinate to your needs.
php option in file manager
Increase upload limit in the cPanel

2. Edit the .htaccess file

The .htaccess file lets yous command key configuration details for your web server. On many hosts, you tin edit this file to increase the max upload filesize limit

Needless to say, it's an extremely crucial file and should be handled with caution.

To start, connect to your server using an FTP client. If you're not sure how to do that, follow our detailed FTP guide.

Before making whatsoever changes, download a copy of the .htaccess file onto your computer equally a backup option. That way, if y'all come across a problem, you can but delete the edited file from your website and upload the quondam file to make things go back to how they were.

download htacess from htaccess
Downloading file from Filezilla

Once you have your backup copy, right-click to edit the file on your server. Then, add together the following code snippet and adapt the values based on your demand:

          php_value upload_max_filesize 128M php_value post_max_size 128M php_value memory_limit 128M        
editing htacess file - upload_max_filesize directive in PHP.ini
Editing the .htaccess file

Shut the file, go to your website, and check whether you lot tin upload big files.

Some of you may come across the following error afterwards inserting the lawmaking – Warning: PHP runs in CGI-fashion.

If you run across this message, it means you tin can't use this control in the .htacess file because of how your hosting surround is configured. Remove the code snippet and attempt some of the adjacent methods.

iii. Edit the wp-config.php file

The wp-config.php file contains important configuration details for your WordPress site. Without the config file, you will lose admission to your site's content. Handle the file carefully.

As function of those configuration details, y'all can make changes to the maximum upload limit on your site.

To begin, connect to your website using an FTP customer and download a copy of the wp-config.php file as a safety cyberspace. If anything goes wrong, y'all can reupload this re-create to your site to brand things get back to how they were.

Next, edit the file and insert the post-obit code snippet above the /* That'due south all, stop editing! line as shown in the image below. Make certain to change the value based on how large files are to be allowed on your website.

@ini_set('upload_max_size' , '128M' );

editing wp-config file - upload_max_filesize directive in PHP.ini
Editing the wp-config file

Save the file, exit, and check if you tin can upload large files to your website. If y'all can't upload the file, then try the next method.

4. Update php.ini via FTP (didn't work for us)

The php.ini is a configuration file and modifying it will override your server settings. Updating the file didn't piece of work for u.s.a. but it is a pop method recommended past hosting providers and then nosotros suggest you give it a attempt.

Whether or not it works really depends on how your hosting server is configured, so it might work for you fifty-fifty though it didn't work for us.

Make sure you have backed upwardly your website before proceeding with the steps.

Like all other configuration files (i.e. wp-config and .htaccess), the php.ini should be located in your root folder.

Connect to your website using an FTP customer.

If yous see an existing file called php.ini, save it on your local computer as a backup. Open up the file and y'all should find an option that says upload_max_filesize = 128M. Change the value to whatever suits you best.

If you don't meet an existing file called php.ini, you can but create a new i in the root folder. Then, edit it and add the following line:

upload_max_filesize = 128M

Make sure to save your changes when you're done.

create new file in file manager - upload_max_filesize directive in PHP.ini
Creating a new file in the File Manager

Fix the "upload_max_filesize directive in PHP.ini" fault for good

In this tutorial, we covered four dissimilar ways of fixing the "The uploaded file exceeds the upload_max_filesize directive in php.ini." fault in WordPress.

If none of the methods worked for you, we recommend uploading the file via FTP and so importing it to your Media Library using a plugin like Add together From Server. But if that fails too, you will need to talk to your hosting provider well-nigh having them increment the upload limit for you.

Do you lot still have any questions about how to set the "upload_max_filesize" fault? Let us know in the comments beneath.

Free guide

v Essential Tips to Speed Upwardly
Your WordPress Site

Reduce your loading fourth dimension by even 50-fourscore%
just by following simple tips.

Download costless guide

rogersobbect.blogspot.com

Source: https://themeisle.com/blog/the-uploaded-file-exceeds-the-upload_max_filesize-directive-in-php-ini/

0 Response to "Exceeds the Maximum Upload Size for This Site Php.ini Is Set"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel