Close

Installation issue – Max upload file size

One of most common issues during theme installation is “Are you sure you want to do this ?”. Usually this error happens when you try to upload a zip file that is larger than maximum upload file size.

Many servers limit maximum upload file size to 10MB, because uploading large files might cause different issues on servers. There are several ways to increase maximum file size and we will read about most common ways to do that in this article.

Before trying any of these methods, please make sure you have ftp access to your server. So you can revert back your modifications if something went wrong.

 

How I can check my server max upload file size?

  1. Please login to your WordPress
  2. Click on “Media > Add New”
  3. Here you can see the maximum upload file size on your WordPress installation

1 – Increasing Max Upload File Size through “Functions.php” file

If you go to “appearance -> editor”, you can find an environment that let you modify core files. Find and select “functions.php” file in right column. Now add the following code at end of file:

@ini_set( ‘upload_max_size’ , ’64M’ );

@ini_set( ‘post_max_size’, ’64M’);

 

Now click on update file and check max upload file size.

In some WordPress Installation editing core file in admin panel is disabled. If that’s the case, you can use FTP client applications to modify that file.

 

2 – Increasing Max Upload File Size through “PHP.ini” File

Servers read PHP configurations from this file, so we want to create a new one and try changing max upload size.

  1. Connect to your website FTP server by any FTP client you like.
  2. Now go to root directory of WordPress installation ( where wp-config.php file is located ).
  3. Look for “php.ini” file ( if it’s not there, create a new one ) and add the following code:

upload_max_filesize = 64M

post_max_size = 64M

 

Save your modifications. Now check max upload file size.

 

3 – Increasing Max Upload File Size through “.htaccess” file

Some servers accept “.htaccess” file modification.

  1. Connect to your website FTP server by any FTP client you like.
  2. Now go to root directory of WordPress installation ( where wp-config.php file is located ). Usually you will find that file but if you couldn’t, please read following stackoverflow question
  3. Add following code at the end of the file

php_value upload_max_filesize 64M

php_value post_max_size 64M

 

Save your modifications. Now check max upload file size.

 

4 – VPS Servers

Some users use their own VPS, please read following article by Jon Schwenn from Digital Ocean to see how you can modify your server php.ini file.

 

If none of those methods worked, please contact your host administrator. They will help you.

Powered by BetterDocs

Leave a Reply