Search code examples
phpiisuploadfastcgiphp-5.6

IIS FastCgiModule returns 500 when uploading large files


I am runnning a IIS server on a server 2008. PHP I am using is 5.6.0

Uploading small files around 1-2 mb works fine, but as soon as I am trying to upload bigger files, IIS returns a 500 error.

My php settings is looking like this:

Post_Max_Size: 800M
Max_Input_time: 300
Upload_max_filesize: 800M
File_uploads: on

There seems to be an generic error in IIS.I have tried everything and it is setup to handle large files by my web.config

<system.web>
    <globalization uiCulture="en-US" />
    <customErrors mode="Off" />
</system.web>
<system.webServer>
    <httpErrors errorMode="Detailed" />
    <security>
        <requestFiltering>
             <requestLimits maxAllowedContentLength="1000000000" />
        </requestFiltering>
    </security>
</system.webServer>

I am now testing with aspx, with this script but it fails:

<%@ Page Language="C#" %>
<!DOCTYPE html>
<script runat="server">
	protected void btn1_Click(object sender, EventArgs e)

	{

		if (upload1.HasFile)

		{

			btn1.Text = upload1.FileName + ":" + upload1.PostedFile.ContentLength;

		}

		else

		{

			btn1.Text = "No File...";

		}

	}

</script>

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

	<title>IIS upload debug</title>

</head>

<body>

	<form id="form1" runat="server" enctype="multipart/form-data">

		<asp:FileUpload runat="server" ID="upload1" />

		<asp:Button runat="server" ID="btn1" OnClick="btn1_Click" Text="Start Uploading" />

	</form>



</body>

</html>


Solution

  • IIS was corrupt and needed a reinstall.

    It even fired up a Blue Screen of Death on clients, when they tried to upload stuff.

    Joakim