Demystifying The Code

PHP and IIS: Running PHP under Fast CGI and Url Rewriting

Introduction

You can run PHP (as well as other CGI apps) on IIS7 with high performance and reliability thanks to FastCGI.  CGI is a protocol that defines how web servers launch an executable resulting from a request, pass it arguments and return the dynamic response.  You have been able to host CGI applications in IIS in the past, however there have been challenges prior to FastCGI.  As it turns out, the challenge is that there are certain modules (in PHP, for instance) that are not thread safe.  For that reason, IIS traditionally spun up a new process for each request.  This provided the reliability necessary in the face of non-thread-safe modules.  However, the performance suffered due to the cost of spinning up all of these processes.  Enter FastCGI.  It guarantees that each process will handle 1 request at a time (providing the reliability), but it allows for process reuse by maintaining a pool of processes.

[ Read More → ]

Self-Signed Certificates on IIS 7 – the Easy Way and the Most Effective Way

I have found myself creating self-signed certificates for developing and testing many times over the years.  It seems that they are spaced out just enough that I forget the process and have to walk up that nasty learning curve again.  Oddly enough, while in the end the process is not difficult, there are some easy wrong turns to take and the good information seems to be spread out over the internet.  For that reason (and so I can refer back to this post later when I need it) I am going to illustrate the typical way to create a self-signed cert on IIS 7, point out the major issue with that process and finally illustrate how to solve that issue once-and-for-all.   

[ Read More → ]

Demystifying The Code