# Mapping php to fcgiext.dll vs php-cgi.exe

I seem to be able to run PHP scripts either by mapping .php to IIS directly by using \PHP\php-cgi.exe or through \Windows\system32\inetsrv\fcgiext.dll.

I can't tell the difference between the two methods, other than that by using fcgiext.dll you are given the option to set custom per site configuration for cgi.

Why shouldn't I map php directly to php-cgi.exe?

-

It's massively slower.

fcgiext.dll runs the FastCGI add-in for IIS, which keeps a pool of PHP-CGI processes "hot" (i.e. running), and then feeds requests through them sequentially.

With the other configuration, for each request, a single process is started (which is not fast), processes that one request, and terminates.

Process startup is time consuming on Windows; FastCGI amortizes the cost of process startup/shutdown by running a few in parallel, pushing lots of requests through them, and then terminating them every (think it's something like) 1000 (configurable) requests.