You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2017/06/20 10:25:40 UTC
[Bug 61202] New: SCRIPT_NAME is broken in 2.4.26, path is stripped
https://bz.apache.org/bugzilla/show_bug.cgi?id=61202
Bug ID: 61202
Summary: SCRIPT_NAME is broken in 2.4.26, path is stripped
Product: Apache httpd-2
Version: 2.5-HEAD
Hardware: PC
OS: Linux
Status: NEW
Severity: major
Priority: P2
Component: mod_proxy_fcgi
Assignee: bugs@httpd.apache.org
Reporter: aidbmfqognnq6gizaigaqaaaaaaaa@protected32.unixadm.org
Target Milestone: ---
Hi,
with 2.4.26 the variable SCRIPT_NAME, which is passed to fcgi applications such
as php-fpm, no longer contains the full uri path.
ex.
http://server.example/~phil/blah.php
$_SERVER['SCRIPT_NAME'] /blah.php
$_SERVER['REQUEST_URI'] /~phil/blah.php
$_SERVER['SCRIPT_FILENAME'] /home/phil/.public_html/blah.php
$_SERVER['CONTEXT_DOCUMENT_ROOT'] /home/phil/.public_html
$_SERVER['CONTEXT_PREFIX'] /~phil
SCRIPT_NAME should be /~phil/blah.php, not /blah.php.
Kind regards
Phil
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 61202] SCRIPT_NAME is broken in 2.4.26, path is stripped
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61202
bjorn@panthera.nl changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bjorn@panthera.nl
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 61202] SCRIPT_NAME is broken in 2.4.26, path is stripped
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61202
Yann Ylavic <yl...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #11 from Yann Ylavic <yl...@gmail.com> ---
Backported to 2.4.27 with r1800618.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 61202] SCRIPT_NAME is broken in 2.4.26, path is stripped
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61202
--- Comment #9 from Jacob Champion <jc...@apache.org> ---
*** Bug 61211 has been marked as a duplicate of this bug. ***
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 61202] SCRIPT_NAME is broken in 2.4.26, path is stripped
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61202
--- Comment #1 from aidbmfqognnq6gizaigaqaaaaaaaa@protected32.unixadm.org ---
SCRIPT_NAME is set to the correct value when using ProxyFCGIBackendType
GENERIC:
$_SERVER['SCRIPT_NAME'] /~phil/blah.php
$_SERVER['REQUEST_URI'] /~phil/blah.php
$_SERVER['SCRIPT_FILENAME'] /home/phil/.public_html/blah.php
$_SERVER['CONTEXT_DOCUMENT_ROOT'] /home/phil/.public_html
$_SERVER['CONTEXT_PREFIX'] /~phil
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 61202] SCRIPT_NAME is broken in 2.4.26, path is stripped
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61202
Dave <ap...@deemzed.uk> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |apache-b6e@deemzed.uk
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 61202] SCRIPT_NAME is broken in 2.4.26, path is stripped
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61202
Jacob P <ja...@cpanel.net> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jacob.perkins@cpanel.net
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 61202] SCRIPT_NAME is broken in 2.4.26, path is stripped
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61202
--- Comment #7 from Eric Covener <co...@gmail.com> ---
(In reply to Eric Covener from comment #6)
> (In reply to Tomas Merta from comment #5)
> > Same bug after upgrade:
> >
> > Config for backend:
> >
> > <FilesMatch \.php$>
> > SetHandler "proxy:unix:/var/run/php-fpm/vu008621.sock|fcgi://vu008621"
> > </FilesMatch>
> > <Proxy fcgi://vu008621 disablereuse=On>
> > </Proxy>
>
> Please open a new bug report. This PR is about a regression.
Sorry, I understand what you wrote now. Thanks for sharing your affected
config.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 61202] SCRIPT_NAME is broken in 2.4.26, path is stripped
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61202
Jocelyn <jo...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jocelyn.flament@gmail.com
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 61202] SCRIPT_NAME is broken in 2.4.26, path is stripped
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61202
--- Comment #8 from aidbmfqognnq6gizaigaqaaaaaaaa@protected32.unixadm.org ---
Hi Eric,
(In reply to Eric Covener from comment #4)
> Hi Phil, I also agree it looks pretty bogus. Out of curiosity, what kind of
> config do you use to map these requests to proxy_fcgi?
I guess it's a very common config:
<IfModule proxy_fcgi_module>
ProxyFCGIBackendType GENERIC
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://fpm-www"
</FilesMatch>
</IfModule>
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 61202] SCRIPT_NAME is broken in 2.4.26, path is stripped
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61202
Thomas Stein <hi...@meine-oma.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |himbeere@meine-oma.de
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 61202] SCRIPT_NAME is broken in 2.4.26, path is stripped
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61202
--- Comment #6 from Eric Covener <co...@gmail.com> ---
(In reply to Tomas Merta from comment #5)
> Same bug after upgrade:
>
> Config for backend:
>
> <FilesMatch \.php$>
> SetHandler "proxy:unix:/var/run/php-fpm/vu008621.sock|fcgi://vu008621"
> </FilesMatch>
> <Proxy fcgi://vu008621 disablereuse=On>
> </Proxy>
Please open a new bug report. This PR is about a regression.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 61202] SCRIPT_NAME is broken in 2.4.26, path is stripped
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61202
--- Comment #3 from Jacob Champion <jc...@apache.org> ---
Thanks for the report. We're currently discussing the right fix; as many of you
have already discovered, using a GENERIC backend type will revert to the 2.4.25
behavior. If you're a 2.4.26 user, you probably should not expect the current
behavior of the FPM BackendType (nor its current status as the "default"
setting) to remain as-is.
Note that the 2.4.25 behavior won't work for everyone either. My eventual goal
is to return us (by default) to the 2.4.20 behavior that seemed to work for
many PHP-FPM users, and letting users of other "incompatible" (i.e. correct)
FCGI daemons use the new ProxyFCGISetEnvIf directive if they need it. Sorry for
introducing this mess with my fix to bug 59618.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 61202] SCRIPT_NAME is broken in 2.4.26, path is stripped
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61202
--- Comment #2 from Dave <ap...@deemzed.uk> ---
The GENERIC/FPM code path change in mod_proxy_fcgi.c looks very wrong,
particularly the "TODO" part responsible for stripping off leading directory
components (390:392) and appending PATH_INFO to SCRIPT_NAME (RFC3875 says no):
379 if (fpm || apr_table_get(r->notes, "virtual_script")) {
380 /*
381 * Adjust SCRIPT_NAME, PATH_INFO and PATH_TRANSLATED for
PHP-FPM
382 * TODO: Right now, PATH_INFO and PATH_TRANSLATED look OK...
383 */
384 const char *pend;
385 const char *script_name = apr_table_get(r->subprocess_env,
"SCRIPT_NAME");
386 pend = script_name + strlen(script_name);
387 if (r->path_info && *r->path_info) {
388 pend = script_name + ap_find_path_info(script_name,
r->path_info) - 1;
389 }
390 while (pend != script_name && *pend != '/') {
391 pend--;
392 }
393 apr_table_setn(r->subprocess_env, "SCRIPT_NAME", pend);
394 ap_log_rerror(APLOG_MARK, APLOG_TRACE4, 0, r,
395 "fpm:virtual_script: Modified SCRIPT_NAME to:
%s",
396 pend);
397 }
Other than rolling back the whole module to 2.6.25, it does indeed look like
setting ProxyFCGIBackendType to GENERIC (which appears to work fine with FPM
for me, too) is the solution.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 61202] SCRIPT_NAME is broken in 2.4.26, path is stripped
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61202
--- Comment #4 from Eric Covener <co...@gmail.com> ---
(In reply to aidbmfqognnq6gizaigaqaaaaaaaa from comment #0)
> Hi,
>
>
> with 2.4.26 the variable SCRIPT_NAME, which is passed to fcgi applications
> such as php-fpm, no longer contains the full uri path.
Hi Phil, I also agree it looks pretty bogus. Out of curiosity, what kind of
config do you use to map these requests to proxy_fcgi?
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 61202] SCRIPT_NAME is broken in 2.4.26, path is stripped
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61202
--- Comment #5 from Tomas Merta <to...@merta.cz> ---
Same bug after upgrade:
Config for backend:
<FilesMatch \.php$>
SetHandler "proxy:unix:/var/run/php-fpm/vu008621.sock|fcgi://vu008621"
</FilesMatch>
<Proxy fcgi://vu008621 disablereuse=On>
</Proxy>
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 61202] SCRIPT_NAME is broken in 2.4.26, path is stripped
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61202
Jacob Champion <jc...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |FixedInTrunk
--- Comment #10 from Jacob Champion <jc...@apache.org> ---
Checked into trunk as r1800306 and proposed for backport to 2.4.x.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org