简体   繁体   中英

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 found here:

Step 1:

First, you need to edit your server's PHP.ini file. This is found in your PHP installation directory, eg 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

you will have to modify the active php.ini which you can get get from a phpinfo() and change both post_max_size and upload_max_filesize accordingly. Once done, restart iis

I had to adapt the first solution above, because I am using Windows Share HostGator site. I had a file in httpdocs called: .user.ini, which I added:

upload_max_filesize = 256M
post_max_size = 256M
max_execution_time = 600
max_input_time = 600

Because I needed it bigger. I also added:

<security><requestFiltering><requestLimits maxAllowedContentLength="268435456"/> 
</requestFiltering></security>

So this allowed me upload larger files. I wanted to be able to upload large videos or mp3 files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM