Uploaded file exceeds upload_max_filesize directive in php.ini

> Troubleshooting, WordPress

This is a common and easy to fix error, it usually occurs when we try to upload a plugin or a multimedia file (image, pdf, audio, video, …) from the WordPress administration panel and the file exceeds the maximum file upload size directive which by default is 2 Megabytes. If the file you are trying to upload is larger than 2MB, WordPress will display this error:

  • When uploading a plugin: The uploaded file exceeds the upload_max_filesize directive in php.ini.
  • When uploading a file to the media library: The size of the document.ext file exceeds the size allowed on this site.
upload_max_filesize WordPress

This limit has the function of preventing us from overloading our project with heavy files.

As you know WordPress is programmed with the PHP language (Hypertext Preprocessor – Hypertext Preprocessor), which at startup loads a series of directives through a file called php.ini.

What is php.ini?

The php.ini file is a special file, where we can declare changes in PHP configuration through its directives. It is one of the essential configuration files, since when PHP starts it is the first file to be executed, so any functionality changes will be read into it.

Some of the most important settings implemented in this file are: upload directory, show errors, log errors, maximumupload size (upload_max_filesize), maximum execution time, etc. This allows for easy administration in the way you manage the Apache web server.

How to solve the problem?

To solve this problem, simply increase the value of the upload_max_filesize directive, which by default is set to 2M (2 Megabytes). You can increase it to 4M, 8M, 10M, 16M, … I recommend that you increase it to 128M, so you won’t have any problems.

There are several ways to change this policy, the easiest is to contact your hosting provider’s technical support service and ask them to do so: “Please I need you to increase the capacity of the upload_max_filesize variable to 128M for the domain aqui-tu-dominio.com, thank you.“Now all you have to do is wait for someone from the support team to make the change.

But you can also do it yourself via your web hosting administrator’s control panel. Let’s see how to do it in the two most popular web hosting administrators Plesk and cPanel.

How to change upload_max_filesize in Plesk

Steps to change upload_max_filesize in Plesk.

Plesk - Websites and Domains
upload-max-filesize in Plesk
  1. Click on Websites and domains
  2. Click on PHP Configuration
  3. We change upload-max-filesize to 128M
  4. Scroll to the bottom of the page and click the OK button.

How to change upload_max_filesize in cPanel

Steps to change upload_max_filesize in cPanel.

upload-max-filesize in cPanel-1
upload-max-filesize in cPanel-2
upload-max-filesize in cPanel-2
  1. In the SOFTWARE section, click on Select PHP Version.
  2. In the next screen click the Options tab
  3. We scroll to the bottom of the page and change the value of the upload_max_filesize directive via the selector

Once the change has been made you will be able to upload files larger than 2 Megabytes and we will have solved the problem.

Suscríbete a Elementor Academy

Subscribe and receive notices of new content

Related topics

Qué tema elegir Astra o Hello Elementor
Which theme to choose Astra or Hello Elementor?
 true
11:02
0.0/5
Introduction to Elementor, WordPress
Aún no hay comentarios o valoraciones
*Guests cannot publish reviews