Reputation: 11
I am uploading small images to a local IIS server running PHP. The images are sent by a POST HTTP request. Whenever the post size exceeds 16kB I get a 500 response from the server saying:C:\PhP\php-cgi.exe - The FastCGI process exited unexpectedly.
The problem persists even if I reduce the PHP script to:
<?php
?>
Also the problem did not occur when I ran the script on mongoose. php_errors.log does not mention the problematic script. I checked my php.ini file for post_max_size and memory_limit and what have you and found nothing to justify a PhP crash on 16kB of data.
I'm pretty new to IIS but I suspect the problem is there. I checked system.webServer/security/requestFiltering and found these values:
I have no idea what could be causing the problem or where to look next. Any help would be appreciated.
EDIT: I found out that http.sys limits request content to 16 kB by default and changed that by adding a MaxRequestBytes field with 16MB value to registry HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters. I was sure that was going to solve it, but it didn't.
Upvotes: 1
Views: 560
Reputation: 11
It's an old thread, but I found a solution that worked for me: It seems that in case the POST request exceeds 16kb of size, PHP is writing a kind of a cache file to its local temp directory. So check your PHP.ini file (upload_tmp_dir) and make sure the local group IIS_IUSRS has write permission to this directory.
Upvotes: 1