There are several small but frustrating hurdles to overcome if you want to upload large files to WordPress if it happens to be running under Windows 2008 and IIS 7.
(In this case, “large files” are any file specifically over 30MB. We’ll see why later.)Step 1: PHP.ini
First, you need to edit your server’s PHP.ini file. This is found in your PHP installation directory, e.g.
c:\program files\php\php.ini and set the following values:
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
max_input_time = 300
This allows PHP to handle files up to 64MB and allows PHP scripts to run up to 5 minutes before timing out.Step 2: WordPress options
Next, we need to tell WordPress to allow files of a certain size to be uploaded. I’m running WordPress 3 in multi-site mode. The max file upload size setting can be found under:
Super Admin |
Step 3: Microsoft IIS 7
Lastly, IIS 7 has a default file upload limit of 30MB. Anything larger than that will cause IIS to return a very unhelpful 404 status. You can read more about it at http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering/requestLimits
To override this, you need to change the web.config settings for (each) site. (The only catch here is that the limits are expected to be in bytes instead of kilobytes.) The following is some copypasta from the MSDN docs:
Don’t forget to recycle your application pool so IIS picks up your PHP.ini changes.
And that’s it!