Bug #65641 [Com]: PHP-FPM incorrectly defines the SCRIPT_NAME variable when using Apache

From: Date: Sat, 31 May 2014 11:16:29 +0000
Subject: Bug #65641 [Com]: PHP-FPM incorrectly defines the SCRIPT_NAME variable when using Apache
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185993@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65641&edit=1

 ID:                 65641
 Comment by:         dz at heroku dot com
 Reported by:        ryotakatsuki at gmail dot com
 Summary:            PHP-FPM incorrectly defines the SCRIPT_NAME variable
                     when using Apache
 Status:             Assigned
 Type:               Bug
 Package:            FPM related
 PHP Version:        5.5.3
 Assigned To:        fat
 Block user comment: N
 Private report:     N

 New Comment:

I can confirm this patch (I used fix_script_name_in_fpm_with_apace_fixed) fixes the issue as
described.

This is pretty critical for Apache 2.4 deployments with PHP-FPM; things are just broken otherwise...


Previous Comments:
------------------------------------------------------------------------
[2014-04-29 18:03:50] php at cizero dot de

fix_script_name_in_fpm_with_apace_fixed worked for me with apache 5.5.11 - Unfortunately the new one
which I tried first did not. Anyway... thanks for these patches !

------------------------------------------------------------------------
[2014-04-29 14:23:37] rainer dot jung at kippdata dot de

I attached a slightly different but functionally mostly equivalent patch. Both patches, the second
version from the original reporter and my second version work for me.

The patch should apply to PHP 5.4 - 5.6. Havent't tried 5.3.

Thanks for considering.

------------------------------------------------------------------------
[2014-03-17 13:55:54] hp4everything at googlemail dot com

sorry for some stupid questions of a newbie in this area:

1) how will a normal Linux user get your correction? Will it be included in official packages with
an offical php-release? Or do I have to build the package mod-fpm myself and apply the patch somehow
in the build-process??

2) do you see any relation to the discussion in

https://bbs.archlinux.org/viewtopic.php?id=178551

In this discussion progandy stated that the package mod_proxy_handler currently is a workaround till
a bug in apache (probably 2.4.9) is corrected. He doesn't mention your patch. He obviously
doesn't see this as mod-fpm problem.


All this is very confusing to someone who only wants to use apache as php-enabled webserver.

------------------------------------------------------------------------
[2014-03-16 17:06:52] ryotakatsuki at gmail dot com

I added fix_script_name_in_fpm_with_apace_fixed that fixes the previous one (it seems it was an
outdated buggy one, wrong malloc call...). I cannot (or don't know how) remove the old one. In
case someone finds it useful :).

------------------------------------------------------------------------
[2014-03-14 16:20:45] hp4everything at googlemail dot com

This problem is still unsolved in release 5.5.10.

The archlinux distribution just updated their packages from apache2.2+mod-php to apache2.4 +
php-fpm.

But since php-fpm does not provide a correct content for the array $_SERVER (at least SCRIPT_NAME
seems to be wrong) php-based websites won't run with apache2.4+php-fpm. 

e.g  the software "owncloud" is not able to run on php-fpm.

Is it possible to provide a source correction based on the available patch (if that has been tested)
in one of the next php-releases for standard Linux-distributions?

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=65641


--
Edit this bug report at https://bugs.php.net/bug.php?id=65641&edit=1


Thread (14 messages)

« previous php.bugs (#185993) next »