The Uploaded File Exceeds the Upload_max_filesize Directive in Php.ini. Cpanel Increase

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

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

The mistake occurs when you are trying to upload a big file which 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 come across this error message.

The prepare? Edit your server'southward configuration settings to increment the maximum upload filesize.

In this article, nosotros are going to assistance you resolve this event by extending the server's default file upload limit.

Don't worry, it's non as difficult as information technology sounds. We will share four unlike methods and you can cull whichever method you find 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" fault?

In the introduction, we talked about 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 resources are existence fairly shared among its users. Past putting a cap on the file size, they brand certain that no single website is using a disproportionate amount of server space or memory.

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

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

The skillful news is y'all tin can overcome this hurdle by irresolute the default limit. However, there are risks involved. One of the most common risks that you lot run into is past making the slightest of error in the .htaccess or wp-config file and your entire website would come up down crashing.

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

How to fix the "upload_max_filesize" error in WordPress

To upload a big file into your website, all you need to practice is increase the upload limit on your server. We'll share four different methods to reach this – at to the lowest degree one of them should work for your site.

Notation: Yous can adjust the upload limit to the desired value as long as your hosting provider supports information technology. If your file size is 10MB and your hosting supports up to 8MB, and then you'd have to move to a ameliorate hosting provider.

To notice your PHP retentiveness limit, go to Tools > Site Health > Info.

site health in wordpress
Finding PHP memory limit on WordPress

1. Modify PHP configurations on cPanel

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

If your hosting provider doesn't offer cPanel, you lot tin try one of the other options on this list.

Hither's how to increment the max upload size in cPanel:

  1. Log into your hosting business relationship.
  2. Open cPanel.
  3. Get to Select PHP Version > PHP Options/Options. Or, in some situations, you might need to wait for a tool chosen 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 you control fundamental configuration details for your web server. On many hosts, you tin edit this file to increment the max upload filesize limit

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

To showtime, connect to your server using an FTP client. If y'all're non certain how to exercise that, follow our detailed FTP guide.

Before making any changes, download a re-create of the .htaccess file onto your computer as a fill-in choice. That way, if you lot encounter a problem, you lot tin can only delete the edited file from your website and upload the old file to make things become dorsum to how they were.

download htacess from htaccess
Downloading file from Filezilla

One time you lot accept your backup copy, correct-click to edit the file on your server. And then, add the following code snippet and adjust 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

Close the file, go to your website, and check whether you can upload big files.

Some of yous may come across the following error afterward inserting the code – Alarm: PHP runs in CGI-way.

If you see this message, it ways you tin can't utilize this command in the .htacess file because of how your hosting environment is configured. Remove the lawmaking snippet and try some of the next methods.

3. Edit the wp-config.php file

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

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

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

Next, edit the file and insert the following code snippet above the /* That'southward all, cease editing! line as shown in the prototype below. Brand 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

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

four. Update php.ini via FTP (didn't piece of work for u.s.)

The php.ini is a configuration file and modifying it volition override your server settings. Updating the file didn't work for united states of america but it is a pop method recommended past hosting providers so we propose you lot requite information technology a try.

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

Make certain y'all have backed up 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 client.

If you encounter an existing file called php.ini, salve it on your local estimator as a fill-in. Open the file and you lot should find an pick that says upload_max_filesize = 128M. Change the value to whatever suits you best.

If y'all don't see an existing file called php.ini, y'all can just create a new one in the root folder. Then, edit it and add the following line:

upload_max_filesize = 128M

Make sure to salve your changes when yous're washed.

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" error 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, nosotros recommend uploading the file via FTP so importing it to your Media Library using a plugin like Add From Server. Merely if that fails too, you will need to talk to your hosting provider near having them increment the upload limit for you.

Practice you lot still take whatsoever questions nigh how to fix the "upload_max_filesize" error? Let us know in the comments below.

Gratis guide

5 Essential Tips to Speed Upwardly
Your WordPress Site

Reduce your loading time by even 50-80%
simply by following uncomplicated tips.

Download free guide

frostsquithrilve52.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 Directive in Php.ini. Cpanel Increase"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel