I have a form where you can upload an XML file and my PHP file parses and imports the file into a database. When I post a 50 mb or less file, it works. But when I post something a bit higher, it returns a "404 Page not found" from IIS. Why is this? Should it return a 500 error instead?..

Could not find anything in the Event Viewer and no error is returned or logged in the PHP error log. I'm lost.

Windows Server 2012
PHP 7.1.1
IIS Version 6.2 (Build 9200)

  • 1
    Can you check the following file %windir%\system32\inetsrv\config\applicationhost.config and find <requestLimits> specifically maxAllowedContentLength and post the value
    – Drifter104
    Jul 19, 2017 at 15:21
  • That is what it was... Yay for silent errors... :( Jul 19, 2017 at 15:22

1 Answer 1


I had to increase the maxRequestLength and maxAllowedContentLength via the configuration editor in IIS.

These values can be found here:


To find these values in IIS:

  1. Click on your site
  2. On the "Feature View" under "Management", click "Configuration Editor"
  3. Use the "Section" drop down menu to navigate to the correct section

Source: https://stackoverflow.com/a/40085473/3208151

  • 1
    Please consider updating the answer with an explanation on how to find the configuration editor. IIS menus are very confusing an PHP developers don't necessarily master it. Dec 20, 2019 at 9:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .