Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
share|improve this question

1 Answer 1

I did a small test using:

AddHandler fcgid-script php fcg fcgi fpl html
FcgidWrapper "/usr/bin/php-cgi -d date.timezone=America/New_York" .html
FcgidWrapper "/usr/bin/php-cgi -d date.timezone=America/New_York" .php

and it was successful in using php to deliver .html files. I would look through you're Apache config file and see if you have declared a handler for .html files beforehand or even after.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.