httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@gmail.com>
Subject Re: mod_rewrite and mod_fcgid pass wrong fcgi request
Date Mon, 16 Nov 2009 00:04:12 GMT
On Sun, Nov 15, 2009 at 5:56 PM, Felipe Alcacibar <falcacibar@gmail.com> wrote:
> ...
>> This is apparently PR 40781:
>>
>> https://issues.apache.org/bugzilla/show_bug.cgi?id=40781
>>
>> I see that one or two people have suggested work-arounds in that PR,
>> but they don't seem to apply directly to your configuration.  Perhaps
>> some mod_rewrite experts on the user list can help solve this, with
>> some adjustment to your mod_rewrite configuration so that in effect
>> PATH_TRANSLATED doesn't get left with "redirect:"?
>
> Effectively, that happens to me, but not in cgi mode (cgid) or with
> php's libphp5 (apxs module) it happens only with mod_fcgid.

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.

>
>>
>> FWIW, changing the FcgidWrapper directive temporarily to point to this
>> Perl script is helpful for seeing what mod_fcgid is telling PHP:
>>
>> #!/usr/bin/perl
>>
>> use strict;
>> use CGI::Fast;
>>
>> while (my $q = CGI::Fast->new) {
>>  print "Content-Type: text/plain\r\n\r\n";
>>
>>  foreach my $env (keys %ENV) {
>>    print "env $env = $ENV{$env}\n";
>>  }
>> }
>>
>> (though possibly you don't have CGI::Fast or its FCGI dependency installed)
>
> for no errors i take the straces dumps from php-cgi with mod_cgid and
> mod_fcgid, to know better what it's happens here is the vars that
> passes to me.
>
> REDIRECT_STATUS: 200
> SERVER_NAME: servicio.fullplanet.cl
> DOCUMENT_ROOT: /hosting/http/fullplanet.cl/dom/servicio/www
> SCRIPT_FILENAME: /hosting/http/fullplanet.cl/dom/servicio/www/index.php
> REMOTE_PORT: 1734
> REDIRECT_URL: /favicon.ico
> GATEWAY_INTERFACE: CGI/1.1
> SERVER_PROTOCOL: HTTP/1.1
> REQUEST_URI: /favicon.ico
> SCRIPT_NAME: /index.php
> PATH_INFO: /favicon.ico
> PATH_TRANSLATED: redirect:/index.php/favicon.ico
>
> The complete list and the strace dumps have here
> http://devel.tryer.cl/fcgid_debug/
>
> ...
>>
>> I wasn't very clear with this suggestion ;)  My thought was to see
>> what it takes to get it working with CGI first, as more people could
>> potentially help with a CGI issue.  Once it works with CGI, it should
>> be straightforward to convert the config to FastCGI.  Also, if the
>> config then doesn't work after converting to FastCGI then it is more
>> likely a mod_fcgid bug.
>>
>
> at least is a bug, that is great to clear me that dude.
>
> but i habe a last dude. The way of the good Open Source Software user
> is to report the bug, but where is the bug, in the mod_fcgid or in the
> mod_rewrite??

I believe that the bug is in mod_rewrite, and is already tracked by

https://issues.apache.org/bugzilla/show_bug.cgi?id=40781

Mime
View raw message