WordPress Error Solution: ‘The uploaded file exceeds the upload_max_filesize directive in php.ini’

Tiempo de lectura: 2 minutos

Reading time: 2 minutes

Good afternoon, friends. Today I have prepared a post that can help you solve a very common error that occurs when uploading heavier-than-normal plugins to your WordPress site.

In this case, we are going to install the plugin wp-rocket (please note that this plugin is paid).

In my case, I already have it downloaded and I’m going to upload the plugin zip file because, as I assume you already know, there are various ways to install a plugin.

In our WordPress dashboard, once inside, from the menu, we select the option “Plugins” > “Add New”. Then, at the top of the screen, we see “Upload Plugin”. We click there, and a bit lower, we have the option to select the file. We choose the zip file of the plugin we downloaded and click “Install Now”.

When we click, we encounter the error I mentioned earlier.

To fix this error, we need to do the following. In the .htaccess file of our local project, accessed through an FTP client (such as FileZilla, for example), at the top, we add these three lines:

php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value memory_limit 128M

In our case, we have set it to 128M, but you can add any value you want:

Once we have edited the file from FileZilla, a notice will appear asking if we want to upload the changed file to the server. We select “Yes” and wait for it to upload.

Once uploaded, we go back to the WordPress Dashboard and try uploading the plugin again. This time, we see that we can install it without any problem, and the error has been resolved.

We go to “Plugins” > “Installed Plugins”, and there it is. We activate it, and it’s ready to use!

I hope this helps you.

Leave a Comment