Following the php documentation, I've set up PHP to work with Apache2+FastCGI with the following configuration (in httpd.conf):
LoadModule fcgid_module modules/mod_fcgid.so
FcgidInitialEnv PHPRC "c:/php"
AddHandler fcgid-script .php .html
FcgidWrapper "c:/php/php-cgi.exe" .php
FcgidWrapper "c:/php/php-cgi.exe" .html
I've tried the following as an alternative for the last three lines as well:
<Files ~ "\.html>"
AddHandler fcgid-script .html
SetHandler fcgid-script
FcgidWrapper "c:/php/php-cgi.exe" .html
</Files>
However, only files that end with .php
are being run as PHP scripts, and files with the .html
extension are not. There doesn't appear to be any other place in the config file that specifies the .php extension so I don't know why httpd is treating them differently.
Directly running php-cgi.exe index.html
produces the expected output, so it would appear the problem lies in httpd not passing control to the cgi executable.
What's the right way to do this?
Specific version information:
- Apache HTTPD 2.2.22
- mod_fcgid-2.3.6-win32
- php-5.2.17-nts-Win32-VC6-x86
- Windows Server 2008 RC2