Edit report at https://bugs.php.net/bug.php?id=51983&edit=1
ID: 51983
Comment by: mabi at gentoo dot org
Reported by: konstantin at symbi dot org
Summary: [fpm sapi] pm.status_path not working when
cgi.fix_pathinfo=1
Status: Assigned
Type: Bug
Package: FPM related
Operating System: Any
PHP Version: 5.3SVN-2010-06-03 (snap)
Assigned To: fat
Block user comment: N
Private report: N
New Comment:
What's the status of this? Any chance we can have that fixed for 5.4?
Previous Comments:
------------------------------------------------------------------------
[2011-07-20 09:16:43] konstantin at symbi dot org
IIS? FPM does not support Windows, and IIS does not support remote FastCGI.
Either
ISAPI or local FCGI (via the cgi-fcgi SAPI) are used togerher with IIS, there's
nothing about fpm.
For all other known webservers, both Jerome's and my proposals should work fine
AFAIK.
------------------------------------------------------------------------
[2011-07-20 09:08:14] slim at inbox dot lv
probably it is worth to have additional setting to set webserver in use and
select appropriate handling method.
Something like "web_server = compliant | apache | iis | anything"
this will simplify appending of hacks for custom implementations of fastcgi
protocol
------------------------------------------------------------------------
[2011-07-17 15:35:58] konstantin at symbi dot org
I remember I've seen a configuration which passed SCIPT_FILENAME but no
DOCUMENT_ROOT. (In nginx, you can define any fastcgi variables in the
configuraton file, there's nothing hardcoded). I have no idea how many such
configurations exist, may be that one was the single of its kind in the world.
But it would be definitely wrong to break anything in the 5.3.x branch.
Well, that extra ini setting is probably really unneeded. May be just leave
support for SCRIPT_FILENAME (handle it always it if is not empty) in 5.3.x, and
drop it in 5.4?
------------------------------------------------------------------------
[2011-07-17 15:29:46] [email protected]
hi,
thx for the feedback. For SCRIPT_FILENAME, I know it became a pseudo standard.
But as the concatenation of DOCUMENT_ROOT and SCRIPT_NAME results in
SCRIPT_FILENAME, I don't really see why you want to keep it with yet another
fpm
configuration line ? Maybe I missed something :)
++ Jerome
------------------------------------------------------------------------
[2011-07-17 14:19:13] konstantin at symbi dot org
Hello,
Here are a few quick thoughts.
1) The fix_pathinfo stuff has been implemented a long ago, and it's main
purpose
was to workaround the bugs of web servers used 10 years ago. It was
developed with the CGI exec()s in mind so the performance impact caused by
multiple stat()s was not so important. I see no reason to keep it
nowadays.
2) The patch I have proposed hase a bug mentioned in a comment above, that must
be fixed. I personally just use fix_patninfo=0 now ;)
3) The CGI protocol itself has been developed (as far as I understand) with a
thought that there's some monolithic application which takes PATH_INFO,
parses it, does something and prints the results. With PHP applications,
there's
usually another case - we need to map the request variables to a physical
path to the php script, the same way as web server SAPIs do. It does not
conform
to any RFCs but that's how people DO use PHP, and that's a behavior everyone
expects in 99.9999% cases.
4) The non-standard SCRIPT_FILENAME fastcgi variable is widely used in many
configurations, and there are standard config samples for nginx etc which rely
on
the fact that it has been working for years.
5) Your proposal seems mostly OK but I'd prefer if the SCRIPT_FILENAME remains
supported.
My proposal would be close to yours:
I. Add the 'fcgi.accept_script_filename' per-pool ini setting, default true;
II. Add the document_root.override per-pool ini setting, default empty.
III. Remove all the fix_pathinfo stuff, and change the corresponding parts of
the init_request_info function according to the pseudocode:
function get_script_filename(ini, Env) {
var script_filename;
if (ini["fcgi.accept_script_filename"] == true && Env["SCRIPT_FILENAME"] is
not empty) {
script_filename = Env["SCRIPT_FILENAME"];
} else {
doc_root = undefined;
assert(Env["SCRIPT_NAME"] is not empty); // *
if (ini["document_root.override"] is not empty) {
doc_root = ini["document_root.override"];
} else {
assert(Env["DOCUMENT_ROOT"] is not empty);
doc_root = Env["DOCUMENT_ROOT"];
}
script_filename = concat(doc_root, Env["SCRIPT_NAME"]);
}
return script_filename;
}
*) assert() means 'respond with status 500 if assertion fails'.
The RFC3875 compliance can be achieved by defining document_root.override and
setting fcgi.accept_script_filename = false.
------------------------------------------------------------------------
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=51983
--
Edit this bug report at https://bugs.php.net/bug.php?id=51983&edit=1