Last Updated | December 28, 2020
The information in our former blog https://www.folio3.com/blog/how-to-configure-fastcgi-on-wamp would present you with any idea what FastCGI is. Other than that, if you are having trouble-configuring FastCGI on Xampp or you are a Xampp user and you want additional performance on windows using Xampp, this is the right place to be. I am going to show you how you can achieve this step-by-step.
Configuring FastCGI with Xampp on Windows
- Download and Extract: http://www.apachelounge.com/download/VC11/modules/modules-2.4-win64-VC11.zip
- Copy “mod_fcgid.so” binary file from the extracted folder in “C:\xampp\apache\modules” directory.
- Download latest PHP binary folder: https://windows.php.net/download/ [non-thread-safe(nts) version].
- Create a folder “C:\XXamp” and extract the above PHP binary in this folder, renaming it to anything(in my case ‘2‘ which makes it C:\XXamp\php7.2)
- Open: C:\xampp\apache\conf\extra\httpd-xampp.conf and disable mod_php by commenting the lines below:
# PHP-Module setup
#LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"
# SetHandler application/x-httpd-php
# SetHandler application/x-httpd-php-source
Add these lines under the above section(in order to enable FastCGI):
# PHP-FastCGI setup
LoadModule fcgid_module modules/mod_fcgid.so
FcgidInitialEnv PATH "C:/XXamp/php7.2;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
FcgidInitialEnv SystemRoot "C:/Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "C:/XXamp/tmp"
FcgidInitialEnv TMP "C:/XXamp/tmp"
FcgidInitialEnv windir "C:/WINDOWS"
# Location php.ini:
FcgidInitialEnv PHPRC "C:/XXamp/php7.2"
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000
Options Indexes FollowSymLinks ExecCGI
AddHandler fcgid-script .php
FcgidWrapper "C:/XXamp/php7.2/php-cgi.exe" .php
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
- Copy your php.ini file from “C:\xampp\php” to “C:\XXamp\php7.2” and open it
- Change the extension_dir path to “C:\XXamp\php7.2\ext” for the extensions to be loaded near the configurations where it resides
- Finally, restart apache and verify that the Server API is set to “CGI/FastCGI”
Note: You have to change this “C:\XXamp\php7.2” path in the above configurations to the one you choose.
I am a work enthusiast who is willing to take challenges to the next level. I am very fond of learning new things and have worked on multiple renowned technologies and frameworks including Salesforce Commerce Cloud, Liferay, OracleATG, Magento 2, Laravel, etc.