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.

I'm trying to run PHP as FastCGI with no success.

I made a *.conf file such on mod_fcgid page but without a wrapper script.

Here is my conf:

# php5 as FastCGI executable
FcgidMaxRequestsPerProcess 10000

# Uncomment the following line if cgi.fix_pathinfo is set to 1 in
# php.ini:
# FcgidFixPathinfo 1

<Location "D:/www">
    AddHandler fcgid-script .php
    Options +ExecCGI
    FcgidWrapper "C:/php/php-cgi.exe" .php

    # Customize the next two directives for your requirements.
    Order allow,deny
    Allow from all
</Location>

The server start normally and fcgid_module is shown with httpd -M, but php files are server as plain text.

share|improve this question

1 Answer 1

Out of curiosity, try changing your line:

AddHandler fcgid-script .php

to

AddHandler fcgid-script php

In order to get yourself up and running, you might also want to consider using mod_fastcgi (note, not mod_fcgid from Apache). A dll is available here http://www.fastcgi.com/dist/mod_fastcgi-2.4.6-AP22.dll Note that this is for Httpd 2.2. (A dll for 2.4 is also available.)

Your config entry would look something like:

LoadModule fcgid_module modules/mod_fcgid.so
<IfModule mod_fastcgi.c>
    Alias /fcgi-bin "C:/www/cgi-bin"
    FastCgiServer "C:/www/cgi-bin/php-cgi.exe" -initial-env PATH=C:/php -initial-env PHPRC=C:/php
    AddHandler php-fastcgi .php
    <Location /fcgi-bin/>
        Options ExecCGI
        SetHandler php-fastcgi
    </Location>
    AddType application/x-httpd-fastphp .php
    Action php-fastcgi /fcgi-bin/php-cgi.exe
</IfModule>

You can probably get away with less, but it works for me on windows.

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.