Http error 500.0 internal server error c:\php\php-cgi.exe the fastcgi process exited unexpectedly

Since the original tech preview release of FastCGI last year, we’ve been seeing a lot of requests for getting Ruby on Rails running with our FastCGI. So, for FastCGI Tech Preview 2, I spent some time researching what http error 500.0 internal server error c:\php\php-cgi.exe the fastcgi process exited unexpectedly would take to enable Ruby on Rails, resulting in “experimental” RoR support in the TP2 release. It is “experimental” because we did only limited testing, and given our lack of experience with Ruby its very hard to tell whether a real Ruby application will work as expected at this point. I am confident that the experience can be improved significantly with community testing, and any necessary fixes to both the FastCGI component and Ruby.

Download the appropriate TP2 package for your OS, which in this case means either the IIS6 32bit FastCGI or IIS6 64bit FastCGI. You can read more about this on my previous blog post. This will install FastCGI on your machine, and enable us to configure it manually later. We will not be using the automatic configuration support in the installer because we will need some customizations specific for RoR later. FastCGI client library on which RoR is dependent in order to use its dispatch. If you see “true”, then its installed correctly.

If not, re-install and give the right path this time. This is a workaround for an IIS-specific behavior in Ruby that actually does not work with IIS. You can also download the already fixed script  if you dont want to do surgery yourself. Creating a sample Ruby application At this point, if you followed the instructions above, you should have Ruby on Rails installed and ready to go on your Windows machine.

This creates the myapp RoR application, and then generates a sample “test” RoR controller. Edit this controller to display some useful stuff by opening appcontrollertest_controller. Configure the RoR application with IIS and FastCGI We are almost there, so don’t panic. This is the sole reason why this walkthrough is limited to W2k3. To create the mapping, click the “Configuration” button on the website, and “Insert” the handler mapping to “fcgiext. Be sure to clear the “Verify that file exists” checkbox.

If you remember in step 1, when we installed the FastCGI TP2 package, we didnt use the installer’s support for registering a FastCGI program. This is because RoR requires some custom settings in the FastCGI config file that the installer doesnt surface. Replace the Arguments with the path the dispatch. Replace the “85358523” number above with your site id. You could omit this if you are not planning to run multiple Ruby applications on your machine. TP2 in order to get Ruby working. At this point, you should be up and running.