The Uploaded File Exceeds the Upload_max_filesize Shared Hosting Certified

Themeisle content is free. When you lot purchase through referral links on our site, we earn a commission. Acquire More

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

The fault occurs when you are trying to upload a big file which tin can be an image, 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 message.

The ready? Edit your server's 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 non as difficult every bit it sounds. Nosotros will share four unlike methods and you can choose whichever method you detect comfy and easy to execute.

📚 Table of contents:

  1. Modify 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" mistake?

In the introduction, we talked about how your hosting prevents large files like images, videos, plugins, or themes from beingness uploaded to the server. They want to ensure that the server resources are being adequately shared among its users. By putting a cap on the file size, they make sure that no single website is using a disproportionate corporeality of server space or memory.

In WordPress, you lot can check your upload limit by opening the Media Library upload expanse – Media > Add New.

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

The good news is you can overcome this hurdle by changing the default limit. Even so, there are risks involved. Ane of the about common risks that yous run into is by making the slightest of error in the .htaccess or wp-config file and your unabridged website would come down crashing.

To safeguard your site from such a nightmare, we recommend taking a fill-in of your website before trying any of the tips in this commodity.

How to set up the "upload_max_filesize" error in WordPress

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

Notation: You can suit the upload limit to the desired value as long as your hosting provider supports it. If your file size is 10MB and your hosting supports upward to 8MB, so y'all'd have to motility to a better hosting provider.

To discover your PHP retentiveness limit, get to Tools > Site Wellness > Info.

site health in wordpress
Finding PHP memory limit on WordPress

1. Modify PHP configurations on cPanel

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

If your hosting provider doesn't offer cPanel, you can effort i of the other options on this listing.

Here's how to increase the max upload size in cPanel:

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

2. Edit the .htaccess file

The .htaccess file lets you lot control central configuration details for your spider web server. On many hosts, y'all can edit this file to increase the max upload filesize limit

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

To start, connect to your server using an FTP customer. If you're not certain how to practice that, follow our detailed FTP guide.

Before making any changes, download a copy of the .htaccess file onto your computer as a backup option. That way, if you lot encounter a problem, y'all tin just delete the edited file from your website and upload the old file to make things go back to how they were.

download htacess from htaccess
Downloading file from Filezilla

Once y'all have your fill-in re-create, right-click to edit the file on your server. Then, add the following code snippet and suit the values based on your need:

          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 yous can upload large files.

Some of you may encounter the following error after inserting the lawmaking – Alert: PHP runs in CGI-way.

If you encounter this message, it ways you can't apply this command in the .htacess file considering of how your hosting surroundings is configured. Remove the lawmaking snippet and effort some of the next methods.

3. Edit the wp-config.php file

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

As office of those configuration details, you tin can make changes to the maximum upload limit on your site.

To begin, connect to your website using an FTP client and download a copy of the wp-config.php file every bit a safety net. If anything goes incorrect, y'all can reupload this copy to your site to make things go back to how they were.

Adjacent, edit the file and insert the post-obit code snippet above the /* That's all, stop editing! line as shown in the image below. Make sure 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

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

4. Update php.ini via FTP (didn't work for united states of america)

The php.ini is a configuration file and modifying information technology volition override your server settings. Updating the file didn't work for the states but it is a pop method recommended by hosting providers so we suggest you lot give it a effort.

Whether or not it works really depends on how your hosting server is configured, and then it might piece of work for you even though information technology didn't work for us.

Make sure you have backed up your website earlier 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 client.

If you run across an existing file chosen php.ini, save it on your local computer as a fill-in. Open the file and you should find an option that says upload_max_filesize = 128M. Change the value to whatever suits you best.

If you don't run across an existing file chosen php.ini, you tin just create a new one in the root binder. And so, edit it and add together the post-obit line:

upload_max_filesize = 128M

Make certain to salvage 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 Managing director

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

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

If none of the methods worked for you, we recommend uploading the file via FTP and then importing it to your Media Library using a plugin similar Add From Server. But if that fails too, you will need to talk to your hosting provider virtually having them increase the upload limit for y'all.

Practise you even so have any questions well-nigh how to fix the "upload_max_filesize" error? Let us know in the comments below.

Costless guide

5 Essential Tips to Speed Up
Your WordPress Site

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

Download free guide

mowbrayunchip40.blogspot.com

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

0 Response to "The Uploaded File Exceeds the Upload_max_filesize Shared Hosting Certified"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel