pen paper writing icon WordPress icon png newspaper icon

3 Easy Ways to Fix “the uploaded file exceeds the upload_max_filesize directive in php.ini.” Error

the-uploaded-file-exceeds-the-upload_max_filesize-directive-in-php

Have you ever tried to upload something on WordPress, only to be greeted by this eerie message saying “the uploaded file exceeds the upload_max_filesize directive in php.ini”? 

It is understandable how frustrating it can be when an error like this ruins your workflow or even your whole day. And to top it off, for someone unfamiliar with an error like this, it can be very time-consuming and frustrating trying to figure out the cause and solution to it. 

But have no fear, we understand your frustration because we’ve all been through this trying to work with WordPress at some point in time, and we know how much time an error like this can take up from your working hours. 

So, don’t worry and sit back tight, we’ll show you some quick and easy solutions to this problem. 

When Does “the uploaded file exceeds the upload_max_filesize directive in php.ini.” Error Occur?  

This error occurs when you try to: 

  1. While uploading a large image, a file, or a video to your WordPress website. 
  2. Installing a large plugin or theme. 
  3. Exceeding the max upload file size.

Here we’ll show you a step-by-step guide on how you can solve this issue. 

But First, Let’s Get to Know The Causes Behind This Issue in the First Place.

Many reputable hosting companies bolster their ad campaigns using words such as “unlimited, unrestricted, uncapped, etc.”

But that is simply not true. Ad campaigns containing taglines such as “unlimited in terms of storage and bandwidth” are far from reality. 

Certain companies tend to save up on their valuable resources by putting restrictions on their servers by not allowing files with a size exceeding 25 Mb or higher. 

Is WordPress to Blame for This Error?

The answer is a resounding no. WordPress has nothing to do with php.ini. Or the error that ensues titled “the uploaded file exceeds the upload_max_filesize directive in php.ini.”

This php.ini. doesn’t come with the default WordPress installation. 

You can check it yourself, by downloading the original WordPress file straight from the official website. 

WordPress File

All the limitations that proceed to the uploaded file exceeds the upload_max_filesize directive in php.ini. WordPress error is imposed by the hosting services and the server’s end of the whole ordeal.  

Let’s start with the solution: 

3 Easy Ways to Fix the uploaded file exceeds the upload_max_filesize directive in php.ini.” Error

Method 1: WordPress cPanel 

If your hosting service provider uses cPanel, you can edit your php.ini. and customize the upload_max_filesize directive value via the cPanel.

cPanel makes it easy for users to manage their websites right from one panel. 

cPanel provides a dedicated tool for increasing the max upload size limit called “MultiPHP INI Editor”. 

From the “MultiPHP INI Editor”, you can edit the values for the max upload size limit. 

From the MultiPHP Panel, click on the ‘’Configure PHP INI basic settings’’ drop-down menu and select your WordPress website from this menu. 

Here, you will find selected PHP directives. To solve your upload_max_filesize issue, edit the following values as per your requirement. 

  • post_max_size: 3000M
  • upload_max_filesize: 3000M

Enter your required value and put “M” after that, which stands for Megabytes.

Congratulations, you’ve just edited your max file size value to 3GB. 

Method 2: Edit php.ini via FTP

As you know, how the php.ini file controls, how your server works with PHP applications.

Start by connecting to your server via FTP and go to the website’s root folder.

You can edit the php.ini file already present in the root folder or create a new file named php.ini:

Create Php.ini file in FTP

Add or modify the code snippet given below:

Paste the code snippet into a new file, and adjust the numbers to suit your needs.

Alternatively, if you’re editing an existing file, find the same directives and modify the numbers accordingly.

Edit php.ini via FTP
upload_max_filesize = 12M
post_max_size = 13M
memory_limit = 15M

Method 3: Fixing the upload_max_filesize value by editing .htaccess values

The upload_max_filesize directive can also be modified by editing your website’s .htaccess file if creating or editing the php.ini file does not work.

The first thing you need to do is connect to your website via FTP and edit the .htaccess file found in its root folder.

Add the following code snippet, ensuring that you’ve adapted the values to as per your requirement:

php_value upload_max_filesize (Value)
php_value post_max_size  (Value)
php_value memory_limit  (Value)
Edit .htaccess via FTP

Bonus, For you GoDaddy users out there: 

How to Fix the ‘uploaded file exceeds the upload_max_filesize directive in php.ini’ Error in WordPress, GoDaddy: 

If you are facing a GoDaddy the uploaded file exceeds the upload_max_filesize directive in php.ini. error while trying to upload a new theme to your WordPress website or any large file. 

Then follow these steps, and you should be able to solve this issue: 

Step 1: Click on “My Account” on the GoDaddy dashboard.

My Account on the GoDaddy dashboard

Step 2: Click on the “Web Hosting” tab & the “Manage” button.

Manage button on My Account

Step 3: Visit the cPanel Admin dashboard.

Visit the cPanel Admin dashboard

Step 4: Click the “File Manager” icon.

File Manager Icon on cPanel

As you click the “File Manager”, you will see a popup menu to select a directory. Select the “Document Root for”.

Step 5: Right-click on the “.htaccess” file.

edit .htaccess file

You will find the “.htaccess” file right under the “wp-includes” folder. Then, click “Edit” on the popup box.

Step 6: Add the following code & hit save

php_value upload_max_filesize 256M

By following these simple steps, you will be able to resolve the uploaded file exceeds the upload_max_filesize directive in php.ini GoDaddy issue. 

And not just GoDaddy; similar steps can be used to resolve the same issue on all the popular web hosting services such as – Bluehost, Hostgator, Hostinger, Dreamhost, etc. 

Summary

After you’ve successfully implemented all these changes, we hope that you’re – the uploaded file exceeds the upload_max_filesize directive in php.ini error has been resolved

If all went well, your php.ini edit worked perfectly and the values you have changed fixed your issue. 

To check if all the changes have been implemented, just head back to your WordPress Dashboard > Media > Add New and try to upload the file, you were initially trying to upload. Now you should be able to upload the said file, without any worries. 

Finally, we hope that you’ve found this helpful. Please do share this with someone who is going through a similar issue.

Saasland
Share: