httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcus Merz" <mm...@gmx.de>
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" <trawick@gmail.com> schrieb im Newsbeitrag 
news:cc67648e0909211455i5cb6c7c3ub4fdcc25cb9cc2f5@mail.gmail.com...
On Mon, Sep 21, 2009 at 2:24 PM, Marcus Merz <mmerz@gmx.de> wrote:


>In my php.ini i have
>
>; cgi.force_redirect is necessary to provide security running PHP as a CGI
>under
>; 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.**
>; http://php.net/cgi.force-redirect
>;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 
CGI.  PHP's
; 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. 
Setting
; this to 1 will cause PHP CGI to fix its paths to conform to the spec.  A 
setting
; of zero causes PHP to behave as before.  Default is 1.  You should fix 
your scripts
; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
; http://php.net/cgi.fix-pathinfo
;cgi.fix_pathinfo=1

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 
retest.

...

>>I hope this clearifies the situation a lot more instead of causing even 
>>more
>>confusion.
>
>
>Yes, it helps a lot.
>
>
>
>>I was happy to give you even more information if you told me what you 
>>need.
>>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>
>
>with
>
>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
                </Files>
        </IfModule>
        <IfModule mod_fcgid.c>
*        <Files ~ (\.php)>
*                SetHandler fcgid-script
*                FCGIWrapper /usr/bin/php-cgi5 .php
*                Options +ExecCGI
*                allow from all
*        </Files>
        </IfModule>
                Options -Includes -ExecCGI
        </Directory>
        Include /srv/www/vhosts/domain.tld/conf/vhost.conf
</VirtualHost>

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.

Rgds,
Marcus 




Mime
View raw message