DawnReel.com

How to Increase the Maximum File Upload Size in WordPress


Intermediate tutorial. Requires some tech knowledge.

Depending on the web hosting company you choose and the package you select, WordPress will have a maximum file upload limit (for installing a Theme, Image or video on your Media Uploader page). Sometimes this limit is not high enough and you won't be able to install a theme or upload a media file. In this article, we will show you how to increase the maximum file upload size in WordPress.org for Lunarpages hosting.

Solution 1: create an .htaccess file in your website's root folder with following code:

# This creates for all add-on sites (for Shared Hosting); for
# Reseller Hosting put in root of each individual account.
<IfModule mod_suphp.c>
suPHP_ConfigPath/home/dawnr2/public_html
</IfModule>

# Use PHP5 as default
AddHandler application/x-httpd-php5 .php

<Files .htaccess>
 order allow,deny
 deny from all
</Files>

<Files php.ini>
 order allow,deny
 deny from all
</File>

<Files wp-config.php>
 order allow,deny
 deny from all
</Files>

Lastly, check that the file permissions (chmod) on .htaccess file are 644 (640 won't work).

Solution 2: Create or Edit an Existing php.ini File

In most cases if you are on a shared host, you will not see a php.ini file in your directory. If you do not see one, then create a file called php.ini and upload it in the root folder. In that file add the following code:

memory_limit = 128M
max_execution_time = 300
upload_max_filesize = 100M
upload_tmp_dir = 128M
post_max_size = 128M

The default max file size for shared hosting is 2M. Oftentimes the theme file alone is way bigger than this and you can't even install the theme. Lastly, check file permissions (chmod) on .htaccess file are 644 (640 won't work).

#3: Other Related Solutions

(a) If you put in 64M and that doesn't work (and you know your file is less than 10M), then try using 64MB (add a "B").

(b) Once you install your WordPress theme it is very important to install a cache plugin. This is the single most important way to optimize your website speed. If you do not have a cache plugin you will often be plagued with other types of out-of-memory problems. Read more about what a cache plugin is and how to get a free one: http://www.elegantthemes.com/blog/resources/the-best-wordpress-cache-plugins-and-how-to-use-them.