Table of Contents

How to install the Apache FastCgi module on Windows ?

About

This article will show you how to install FastCgi on a Apache HTTP server thanks to the FastCGI Module of Apache 1)

It's a configuration step in the Windows installation.

Steps

Download the FastCgi module

The FastCgI module is not in the windows installer and needs to be downloaded accordingly.

httpd -v

Example of output:

Server version: Apache/2.4.46 (Win64)
Apache Lounge VS16 Server built:   Mar 27 2021 11:42:37

In our case, we have chosen to download the pre-compiled FastCGI of Apache Lounge: mod_fcgid-2.3.10-win64-VS16.zip

Apache Installation

Copy mod_fcgid.so to your apache/modules folder

In our case, C:\Apache24\modules

Apache Configuration for php

Add to your httpd.conf:

LoadModule fcgid_module modules/mod_fcgid.so
FcgidInitialEnv PATH "c:/php;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
FcgidInitialEnv SystemRoot "C:/Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "C:/WINDOWS/Temp"
FcgidInitialEnv TMP "C:/WINDOWS/Temp"
FcgidInitialEnv windir "C:/WINDOWS"
FcgidIOTimeout 64
# for testing purpose, 240 seconds to not have an end of connection while debugging
FcgidConnectTimeout 240
FcgidMaxRequestsPerProcess 1000 
FcgidMaxProcesses 50 
FcgidMaxRequestLen 8131072
# Location php.ini:
FcgidInitialEnv PHPRC "c:/php"
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000

<Files ~ "\.php$>"
  AddHandler fcgid-script .php
  FcgidWrapper "c:/php/php-cgi.exe" .php
</Files>

For more information, you can refer to the Configuration page

Restart the Apache service

Start a terminal as administrator

httpd -k stop
The 'Apache2.4' service is stopping.
The 'Apache2.4' service has stopped.

httpd -k start

Check

You can check that php is running with fastcgi via the phpinfo.

Phpinfo Fastcgi