4 Easy Ways To Fix “The Uploaded File Exceeds The upload_max_filesize Directive in php.ini” Error
Bulletproof Backups for Your WordPress Website
Fortify your business continuity with foolproof WordPress backups. No data loss, no downtime — just secure, seamless operation.

“The uploaded file exceeds the upload_max_filesize directive in php.ini” is an error most WordPress users are quite familiar with.
You’re about to upload a file, and suddenly, hit a snag because the file is just too large for the current settings. We’ve been there too, and understand how frustrating it is.
But don’t worry, there’s good news: fixing this isn’t as daunting as it seems. In this article, we’ll guide you through some easy steps to adjust your settings so you can upload bigger files without any headaches.
TL;DR: The “uploaded file exceeds the upload_max_filesize directive in php.ini” error occurs when your file surpasses the server’s limit, but you can resolve it by adjusting your settings. Use a backup plugin to back up your entire site before editing core files to ensure you can easily troubleshoot any issues.
Understanding the “the uploaded file exceeds the upload_max_filesize directive in php.ini” error

Running into a file size error on your WordPress site can be a real headache. This happens when the file size goes beyond what your server allows, and it’s a common upload error.
Here’s what’s going on: Your hosting provider sets a maximum file size limit using the upload_max_filesize directive in the php.ini file. This limit is often set low, like 2MB or 8MB, to ensure the server remains quick and efficient for everyone.
You can check your current upload limit by looking in the Upload Media section or heading to Site Health > Info > Server.
Being aware of these limits can help you plan better for managing your site’s content. Different hosting plans may have different size restrictions, so it’s a good idea to check what your plan allows.
But don’t worry, you’re not stuck with this limit. In the next section, we’ll go over some methods to increase it and give you more flexibility with your uploads.
How to fix the “the uploaded file exceeds the upload_max_filesize directive in php.ini” error
Before you start, remember to create a backup of your site. It’s like having a safety net to protect your work just in case something goes wrong.
1. Talk to your host
One of the easiest and non-risky ways to solve this is by contacting your hosting provider. They can adjust the file size limit on the server for you. Just reach out through a call or support ticket, and they’ll take care of it.
This way, you don’t have to worry about making the changes yourself.
2. Edit the .htaccess file
Access your site: Use an FTP client to locate the .htaccess file in your site’s directory.

Add code: Open the file and add these lines of code to increase the file size limit:
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
This code helps your uploads by increasing the maximum file size and ensuring there’s enough time for uploads to complete. Once you’re done, save the file.
3. Edit the php.ini file via cPanel
Log into cPanel: Access cPanel and locate the php.ini file.

Adjust file size limit: Look for upload_max_filesize and set it to a higher value like 64M or anything that suits your needs.
Save changes: Save the changes, and restart the server if needed to apply the updates.
4. Use a Plugin
While using a plugin can be a quick fix, it’s not always recommended. Plugins can sometimes cause conflicts with other parts of your site or even lead to performance issues. It’s best to use this method if you’re comfortable managing plugins and are aware of the potential risks involved.
Install and activate the plugin: Get the MaxUploader plugin from your WordPress dashboard.

Configure settings: Adjust the upload size limit within the plugin settings. Once done, make sure to save the new settings to apply the changes.

How to prevent this error from occurring again
Nobody likes running into upload issues, so let’s make sure it doesn’t happen again. Here’s how you can keep your WordPress site running smoothly:
Check your settings regularly: Make a habit of checking your php.ini settings and the limits set within the file to ensure they align with your needs. This way, you won’t be caught off guard.
Set limits wisely: Make sure the upload_max_filesize is set a little higher than the largest file you plan to upload. Also, remember to bump up post_max_size to support those bigger uploads.
Monitor your server: Keep an eye on how your server is performing. If you’re uploading bigger files, ensure your server can handle them without slowing down.
Compress files: Before uploading, consider compressing your files to reduce their size. This helps in managing space and resources better.
Backup your entire site: Regularly backup your entire site to ensure you can restore your site quickly if anything goes wrong.
Parting thoughts
Regularly back up your site as a precaution. While upload limits can be frustrating, they’re manageable with the right approach. Choose a method that fits your comfort level, but be cautious of potential impacts on site performance.
Contact your hosting provider for support if needed, and review your server settings as your site grows to ensure everything runs smoothly.
FAQs
How to fix the error “The uploaded file exceeds the upload_max_filesize directive in PHP.ini”?
To fix this error, you need to increase the upload_max_filesize limit in your server settings. You can do this by editing the .htaccess file, the php.ini file, or using a plugin. Alternatively, you can contact your hosting provider to make these changes.
How to change the maximum upload size in PHP ini?
To change the maximum upload size in the php.ini file, locate the upload_max_filesize directive and increase its value. Access this file through your hosting control panel, such as cPanel, or via FTP, make the change, and save it.
What is upload_max_filesize?
The upload_max_filesize is a directive in PHP that sets the maximum size of files that can be uploaded to your server. It helps manage server resources and prevent oversized files from causing issues.
What is the PHP ini file?
The php.ini file is a configuration file for PHP that controls various settings for how PHP operates on your server. It includes directives for file upload sizes, memory limits, and much more.
How to edit the PHP ini file?
To edit the php.ini file, access it through your hosting control panel, like cPanel, or via FTP. Once located, open the file, make the necessary changes, and save it. You may need to restart your server for changes to take effect.
Tags:
Share it:
You may also like

WordPress Debug Log 101: Your Essential Guide to Troubleshooting
Dealing with errors on your WordPress site can be a real hassle, especially when the cause of the error isn’t apparent. These issues have a way of disrupting your workflow,…

3 Easy Ways To Create WordPress Database
Are you building a locally hosted website? Are you developing a staging environment? Maybe you’re simply setting up a brand-new site from scratch. Whatever the reason, creating a WordPress database…

Installation Failed Destination Folder Already Exists? Try These 2 Quick Fixes!
You’re manually uploading a file to your WordPress site for an update, but something went wrong. The update has failed. Perhaps a connection issue or another interruption has occurred, and…
How do you update and backup your website?
Creating Backup and Updating website can be time consuming and error-prone. BlogVault will save you hours everyday while providing you complete peace of mind.

Updating Everything Manually?
But it’s too time consuming, complicated and stops you from achieving your full potential. You don’t want to put your business at risk with inefficient management.

Backup Your WordPress Site
Install the plugin on your website, let it sync and you’re done. Get automated, scheduled backups for your critical site data, and make sure your website never experiences downtime again.