Search code examples
phpwordpressiis-7web-config

Increase File Upload Size Wordpress / IIS 7


I'm trying to increase the file upload size in a Wordpress blog to allow an admin to post his e-books and large PDF files. The site is hosted on GoDaddy / IIS 7. I have tried the following with no luck: web.config: <configuration><system.webServer><security><requestFiltering><requestLimits maxAllowedContentLength="10000000"/></requestFiltering></security></system.webServer></configuration>

php.ini in root of site: upload_max_filesize = 64M

Any advice is greatly appreciated. Thanks, Shawn


Solution

  • Solution found here:

    Step 1:

    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:

    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!

    http://refactored.tumblr.com/post/4609761388/wordpress-iis7-uploads