1
votes

I am encountering this FastCGI exited unexpectedly and I do not know how to resolve this error. I have looked around stackoverflow for solutions but the either the suggested solutions don't apply or no answers provided to the question. I want to run very basic django website (in fact I just created it) using IIS server with WFastCGI.

Here is my spec:

IIS 10.0
Windows Server 2016
Django 1.11.4.
Python 3.6.2
wfastcgi 3.0.0

My python installation is in C drive. I am creating a virtualenv in D drive and pointing path to virtualenv's Python when configuring. When I point to virtualenv's Python, this error 'FastCGI process exited unexpectedly'. If I point my path to C's python, this error disappears (There is another python cant find module error but I can resolve that). I do not know the reason for this fastcgi exited issue when I use virtualenv's python. Kindly enlighten me if possible.

Here is the detailed error info:

Module
   FastCgiModule 

Notification
   ExecuteRequestHandler 

Handler
   djangohandler 

Error Code
   0xc0000135 

Requested URL
   http://localhost:8089/ 

Physical Path
   D:\inetpub\django\foo 

Logon Method
   Anonymous 

Logon User
   Anonymous 
1

1 Answers

0
votes

This question is almost a year old, but I stumbled on to it while having the exact same thing happen for a Python/Flask site under IIS using wfastCGI:

Accessing the site just returns a 500 error without information, except for error code 0xc0000135.

Even when you enable wfastcgi.py to log, by setting the WSGI_LOG environment variable to a writable path, nothing is logged. Enabling Failed Request tracing in IIS also gives no more information besides "FASTCGI_UNEXPECTED_EXIT" and the Windows event logs are empty as well.

I found a possible answer for IIS running PHP, that had the same problem. In that case, installing the proper Microsoft Visual C++ Redistributable package fixed the problem.

I did the same (using the VC++ 2015 x86 package, because I'm running Python 3.5.4 32-bits) and everything worked. No need to reboot, but I did restart the application pool.

You can find out what C++ version corresponds with your Python version here.

The Redistributable packages are located here.