httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcus Merz" <>
Subject Re: mod_fcgid: Problem serving binary content with Apache 2.2.13 - PHP 5.2.9
Date Tue, 22 Sep 2009 05:21:49 GMT
Hi Jeff,

"Jeff Trawick" <> schrieb im Newsbeitrag
On Mon, Sep 21, 2009 at 2:24 PM, Marcus Merz <> wrote:

>In my php.ini i have
>; cgi.force_redirect is necessary to provide security running PHP as a CGI
>; most web servers.  Left undefined, PHP turns this on by default.  You can
>; turn it off here AT YOUR OWN RISK
>; **You CAN safely turn this off for IIS, in fact, you MUST.**
>;cgi.force_redirect = 1
>so it defaults to 1 which is why i set the same in mod_fcgid.conf via
>'PHP_Fix_Pathinfo_Enable 1'.
>I'm not aware of a connection between cgi.force_redirect and 
>PHP_Fix_Pathinfo_Enable.  What do you know about that?

I am sorry. It was meant to read:

; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for 
; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to 
not grok
; what PATH_INFO is.  For more information on PATH_INFO, see the cgi specs. 
; this to 1 will cause PHP CGI to fix its paths to conform to the spec.  A 
; of zero causes PHP to behave as before.  Default is 1.  You should fix 
your scripts

I copied the wrong part from my php.ini. Also for the missing environment 
variables i should have tested from the same conditions but i did 
http://domain.tld/phpinfo.php on mod_fcgid config and 
http://www.domain.tld/admin/phpinfo.php on the mod_cgi config. A difference 
in variables is to be expected then. I will get back to this later today and 


>>I hope this clearifies the situation a lot more instead of causing even 
>Yes, it helps a lot.
>>I was happy to give you even more information if you told me what you 
>>I would really like to get this solved (and apologies concerning the
>>formatting of these variables).
>No problem.
>Please try translating the CGI config directly to FastCGI as noted above, 
>instead of using the Plesk-generated config, and let us know what happens.
>Replace this bit
><Files ~ (\.php)>
>    SetHandler fcgid-script
>    FCGIWrapper /usr/bin/php-cgi5 .php
>    Options +ExecCGI
>    Allow from all
>  </Files>
>Alias /phppath/ /usr/bin/
>  <Location /phppath/>
>    SetHandler fcgid-script
>    Options +ExecCGI
>  </Location>

I get a configuration error when i try to do replace that bit (in the lines 
where i put a *) and 'rcapache2 reload' after because that part sits in a 
VirtualHost container nested within <Directory>. The first error was: "Alias 
not allowed here":

<VirtualHost <IP>:80>
        <IfModule mod_fcgid.c>
                <Files ~ (\.fcgi)>
                        SetHandler fcgid-script
                        Options +FollowSymLinks +ExecCGI
        <IfModule mod_fcgid.c>
*        <Files ~ (\.php)>
*                SetHandler fcgid-script
*                FCGIWrapper /usr/bin/php-cgi5 .php
*                Options +ExecCGI
*                allow from all
*        </Files>
                Options -Includes -ExecCGI
        Include /srv/www/vhosts/domain.tld/conf/vhost.conf

but i got your point. I will try to replicate your setup later today.

At least i am glad to hear that the script works with mod_fcgid if using the 
same config than with mod_cgi.


View raw message