Upload Max File Size Wordpress Php Ini

Themeisle content is costless. When y'all purchase through referral links on our site, we earn a commission. Learn More

Did you just endeavor to upload a file to your WordPress site but to be met past an error message proverb "the uploaded file exceeds the upload_max_filesize directive in PHP.ini"?

The error occurs when you lot are trying to upload a large file which can exist 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 fault message.

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

In this article, nosotros are going to aid yous resolve this issue past extending the server's default file upload limit.

Don't worry, it'south not as difficult as information technology sounds. We volition share four different methods and you can choose whichever method you find comfortable and easy 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" mistake?

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

In WordPress, y'all 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 adept news is you tin can overcome this hurdle by changing the default limit. Still, there are risks involved. 1 of the most common risks that yous encounter is by making the slightest of fault 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 any of the tips in this commodity.

How to gear 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. Nosotros'll share iv different methods to achieve this – at least i of them should work for your site.

Annotation: You can conform the upload limit to the desired value every bit long equally your hosting provider supports it. If your file size is 10MB and your hosting supports upward to 8MB, then you'd have to move to a better hosting provider.

To discover your PHP memory limit, go to Tools > Site Health > Info.

site health in wordpress
Finding PHP memory limit on WordPress

1. Modify PHP configurations on cPanel

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

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

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

  1. Log into your hosting account.
  2. Open cPanel.
  3. Go to Select PHP Version > PHP Options/Options. Or, in some situations, you might need to look for a tool chosen MultiPHP INI Editor.
  4. Alter 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 control key configuration details for your web server. On many hosts, yous can edit this file to increase the max upload filesize limit

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

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

Earlier making any changes, download a copy of the .htaccess file onto your computer equally a backup choice. That way, if you lot encounter a trouble, you lot can just delete the edited file from your website and upload the old file to make things become back to how they were.

download htacess from htaccess
Downloading file from Filezilla

Once y'all take your backup copy, right-click to edit the file on your server. 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 large files.

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

If you meet this message, it means you tin can't use this command in the .htacess file because of how your hosting environs is configured. Remove the code snippet and effort some of the adjacent 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 will lose access to your site's content. Handle the file carefully.

As part of those configuration details, you tin 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 as a safety cyberspace. If annihilation goes wrong, you tin can reupload this copy to your site to make things go back to how they were.

Next, edit the file and insert the following code snippet above the /* That's all, end editing! line as shown in the epitome 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

Relieve the file, go out, and check if you can upload large files to your website. If you lot can't upload the file, then endeavor the next method.

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

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

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

Brand sure you accept 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 customer.

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

If yous don't meet an existing file called php.ini, you tin just create a new one in the root folder. And then, edit it and add the following line:

upload_max_filesize = 128M

Make sure to save your changes when you'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" 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." fault in WordPress.

If none of the methods worked for you, we recommend uploading the file via FTP and and so importing information technology to your Media Library using a plugin like Add From Server. Simply if that fails also, you lot will need to talk to your hosting provider about having them increase the upload limit for you lot.

Practice you still take whatsoever questions about how to gear up the "upload_max_filesize" error? Allow united states of america know in the comments below.

Gratis guide

5 Essential Tips to Speed Upward
Your WordPress Site

Reduce your loading time by even 50-eighty%
just past following simple tips.

Download costless guide

shermanwitiferce.blogspot.com

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

0 Response to "Upload Max File Size Wordpress Php Ini"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel