Can't upload/install WP Rocket

Are you seeing this error message when you try to upload WP Rocket through your WordPress dashboard?

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

This message means there is a low limit on the file size you can upload to your site. This limitation may be set at the site level or by your host.  The WP Rocket zip file is just over 2MB so if the limit for your site is 2MB or less you would see this error message. 

Quick fix

To resolve it automatically, install the plugin Increase Max Upload Filesize: https://wordpress.org/plugins/upload-max-file-size/

If that plugin is not able to fix it automatically, you have the following options:

  • You can install WP Rocket by uploading via FTP
  • Contact your host to increase the upload limit. 
  • Or, if you're comfortable editing files you can follow the manual steps below to manually increase the upload limit.

Manual fix

How to increase the upload_max_filesize limit

It's possible to increase the defined limit by using one of the directives below. Depending on your server setup and host, the method that works could vary from case to case. You don't have to edit all these files, just find the one that works for your site. 

In each example below ,"10M" represents a 10MB file size limit. You may set that number as you wish, but be sensible and don't set it too high.

Make sure you backup your files before editing them!

.htaccess

php_value upload_max_filesize 10M

php.ini file

If your host allows you to modify your site's configuration with a custom php.ini file, you may use the following: 

upload_max_filesize = 10M

wp-config.php

@ini_set('upload_max_size' , '10M');

functions.php 

If you use a child theme, you may add the following to the functions file:

@ini_set('upload_max_size' , '10M');

Check your current upload limit

To verify if your attempt to increase the upload limit was successful you can check the current limit.

Go to: Media > Add New

Underneath the upload area you will see: Maximum upload file size

After implementing one of the above methods, if the limit hasn't changed it means your host is controlling this and you'll have to contact them directly.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.