Skip to content

How to fix: 'The uploaded file exceeds the upload_max_filesize' error ​

You may see the following error when you try to install a Themeisle theme or plugin:

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

This happens because of the upload file limits of your hosting provider. The best solution is to contact your hosting provider and ask them to increase the file size limit. You can also try to solve the problem on your own with one of these methods:

In this article

1. Using the functions.php file ​

Add the following code to your child theme's functions.php file:

php
@ini_set( 'upload_max_size' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'max_execution_time', '300' );

If the error is gone, you can stop here. If not, try the second method.

2. Create or edit a php.ini file ​

Add the following code to your php.ini file, which you can find in the root directory. If there isn't one, create one:

ini
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

If the error is still there, try the third method.

3. Using .htaccess ​

Open or create the .htaccess file in the root folder and add the following code:

apache
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300

If the error persists, contact your hosting provider.

Was this helpful?