Fix: The uploaded file exceeds the upload_max_filesize directive in php.ini

The uploaded file exceeds the upload_max_filesize directive in php.ini

If you see “The uploaded file exceeds the upload_max_filesize directive in php.ini” In your WordPress site, it means your host provider has limited your max file upload limit. There are a few ways you can increase your max file upload limit and memory limits, but here is the fix that works with every hosting provider.

Edit .htaccess File With cPanel

Log in to your cPanel. Find the .htaccess file in your site’s root folder. Make a copy of it or download a backup before making any changes.

Once you have a backup, paste this at the very top of your .htaccess file.

php_value upload_max_filesize 512M
php_value post_max_size 512M

It should look like this. Once you have changed the value, click save and clear all the cache from your site to see the new changes.

php_value upload_max_filesize 512M
php_value post_max_size 512M

These two values are for the max upload file size.

Edit .htaccess File From WordPress

You can use WP Htaccess Editor to edit the .htaccess file directly from the WordPress admin dashboard. Download the plugin and access the .htaccess file from

Settings>WP Htaccess Editor

Add the value at the very top of the .htaccess file

php_value upload_max_filesize 512M
php_value post_max_size 512M

Increase WordPress Memory Limits

You can use the same method to increase WordPress memory limits. Edit your .htaccess file and add.

php_value memory_limit 512M

This value increases the max memory limits for your WordPress site. It usually needs to be increased if you are using a resource-hungry theme.

The uploaded file exceeds the upload_max_filesize directive in php.ini, is a very common error for a WordPress site. You can fix the issue in less than 2 minutes by following this guide.

NOTE: Take a backup of your site or the .htaccess file before making any changes. Making any wrong changes in the .htaccess file can break your site.

 

Share:

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top