Setting up PHP as Fast CGI (FCGI) under Apache
Submitted by chris on November 29, 2006 - 04:22. Apache modules (PHP...) | PHP Install1) Download the Apache mod_fcgi module: http://fastcgi.coremail.cn/
2) Configuration in your Apache httpd.conf:
a) LoadModule fcgid_module modules/mod_fcgid.so
b.1) <Directory "C:/Apache2/htdocs/php/">
SetHandler fcgid-script
Options execCGI
AllowOverride None
Order allow,deny
Allow from all
FCGIWrapper "c:/php/php-cgi.exe" .php
</Directory>
b.2) This works too (it's actually the method I'm using):
AddHandler fcgid-script .php
<Directory "C:/Apache2/htdocs/php/">
FCGIWrapper "c:/php/php-cgi.exe" .php
Options ExecCGI
allow from all
</Directory>
So using method b.2:
Just add to your httpd.conf:
AddHandler fcgid-script .php
Then in the folders running your PHP scripts:
FCGIWrapper "c:/php/php-cgi.exe" .php
Options ExecCGI
3) To overwrite any of the default FCGI directives in your httpd.conf see:
http://fastcgi.coremail.cn/doc.htm
One particular setting is recommend:
MaxRequestsPerProcess 500
4) This is in the doc but if you missed it:
Note: If you get:
DefaultInitEnv PHPRC "c:/php/"
DefaultInitEnv PATH "c:/php;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
DefaultInitEnv SystemRoot "C:/Windows"
DefaultInitEnv SystemDrive "C:"
DefaultInitEnv TEMP "C:/WINDOWS/TEMP"
DefaultInitEnv TMP "C:/WINDOWS/TEMP"
DefaultInitEnv windir "C:/WINDOWS"
(Thank Steffen of apachelounge.com for this note)
Note: SiteBuddy.com is now under FCGI also using eAccelerator 0.9.5.

