httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <>
Subject Re: mod_rewrite and mod_fcgid pass wrong fcgi request
Date Mon, 16 Nov 2009 12:06:12 GMT
On Mon, Nov 16, 2009 at 1:04 AM, Felipe Alcacibar <> wrote:
> ...
>> When comparing modes of PHP execution:
>> - CGI and FastCGI are directly comparable because the information that
>> Apache needs to pass to PHP is the same.  (In fact, mod_cgi[d] and
>> mod_fcgid use the same core Apache code to build almost all of that
>> information.)
>> You should be able to take your CGI configuration and change the
>> handler from cgi-script to fcgid-script and have PHP work as FastCGI.
>> One nuance is that if you're relying on ScriptAlias you'll need to use
>> both Alias and Options +ExecCGI in the FastCGI equivalent.
>> - mod_php and mod_fcgid configurations are not comparable.
> As you sayed it i made a similar environment (the difference is the
> FcgidWrapper line)

PHP can be configured via Action instead of FcgidWrapper with
mod_fcgid too.  That is the most direct comparison.

>                          from mod_cgid to mod_fcgid and the result is the
> same, in the mod_cgid environment all runs good and in the mod_fcgid
> persisst the problem...
> rohan counter # cat /etc/apache2/modules.d/70_php5_cgi.conf
> <IfDefine PHP5CGI>
>        ScriptAlias /.httpd/cgi-interpreters /var/cgi-interpreters/
>        <Directory "/var/cgi-interpreters">
>                AllowOverride None
>                Options None
>                Options +ExecCGI
>                Order allow,deny
>                Allow from all
>        </Directory>
>        <IfDefine FCGID>
>        FcgidWrapper "/var/cgi-interpreters/php-cgi" .php
>        FcgidWrapper "/var/cgi-interpreters/php-cgi" .php2
>        FcgidWrapper "/var/cgi-interpreters/php-cgi" .php3
>        FcgidWrapper "/var/cgi-interpreters/php-cgi" .php4
>        FcgidWrapper "/var/cgi-interpreters/php-cgi" .php5
>        FcgidWrapper "/var/cgi-interpreters/php-cgi" .phtml
>        FcgidInitialEnv PHP_FCGI_CHILDREN "12"
>        FcgidInitialEnv PHP_FCGI_MAX_REQUESTS "1"

BTW, check the mod_fcgid docs for comments on these two PHP
environment variables.

>        AddHandler fcgid-script .php .php3 .php4 .php5 .php6 .phtml
>        </IfDefine>
>        <IfDefine !FCGID>
>                AddHandler php-script .php .php3 .php4 .php5 .php6 .phtml
>                Action php-script "/.httpd/cgi-interpreters/php-cgi"
>        </IfDefine>
>        <FilesMatch \.ph(p[2-6]?|tml)$ >
>                Options +ExecCGI
>        </FilesMatch>
>        DirectoryIndex index.php index.php3 index.php4 index.php5 index.phtml
> </IfDefine>
> Any suggestion or step to do??...

Use Action with mod_fcgid too so that mod_fcgid processing works
through the same mechanisms as with your mod_cgid setup.

I'll try to find some time today to play with that as well.
Eventually I'd like the documentation to show an Action-based example,
with support for easily switching between CGI and FastCGI for
debugging or other purposes.

View raw message