What are the differences between installing PHP as CGI or ISAPI on an IIS server?

When installing PHP on an IIS server, one of the key differences between using CGI and ISAPI is the way in which PHP interacts with the web server. With CGI, PHP runs as a separate process for each request, while with ISAPI, PHP runs as a single process within the web server. CGI can be slower due to the overhead of starting a new process for each request, but it offers better isolation and stability. ISAPI is generally faster as it eliminates the overhead of starting a new process for each request, but it may be less stable due to running within the web server process. To install PHP as CGI on an IIS server, you would typically download the PHP CGI binary from the PHP website and configure IIS to handle PHP files by setting up a handler mapping. Here is an example of how you can configure IIS to use PHP as CGI: ```xml <configuration> <system.webServer> <handlers> <add name="PHP-CGI" path="*.php" verb="GET,POST,HEAD" modules="CgiModule" scriptProcessor="C:\PHP\php-cgi.exe" resourceType="File" requireAccess="Script" /> </handlers> </system.webServer> </configuration> ```