https://issues.apache.org/bugzilla/show_bug.cgi?id=52795
Bug #: 52795
Summary: mod_fcgid fails to spawn process in C:\Program Files
Product: Apache httpd-2
Version: 2.2.17
Platform: PC
Status: NEW
Severity: normal
Priority: P2
Component: mod_fcgid
AssignedTo: [email protected]
ReportedBy: [email protected]
Classification: Unclassified
If ScriptAlias contains spaces (such as "C:\Program Files\..."), then mod_fcgid
fails to spawn the process.
In error.log, I see something similar to:
"Can't run C:\Program"
The problem seems to be in fcgid_proc_win.c:proc_spawn_process, which seems to
tokenize the command-line without distinguishing between spaces in the
executable path and spaces between command-line arguments. The following code
is responsible:
/* Build wrapper args */
argc = 0;
tmp = cmdline;
while (1) {
word = ap_getword_white(procnode->proc_pool, &tmp);
if (word == NULL || *word == '\0')
break;
if (argc >= APACHE_ARG_MAX)
break;
wargv[argc++] = word;
}
wargv[argc] = NULL;
The following workaround solves the problem for me. However, it makes it
impossible to pass any additional arguments to the FastCGI process (which is
probably not an issue for most people):
// HACK(flw): Strip all command-line arguments and make the CGI path
the first.
// This works around a problem of the code above which splits the command
name at every whitespace.
argc = 1;
wargv[0] = procinfo->cgipath;
Please note: I am aware of bug#52436. However, I think that is a different
problem, because it occurs on Ubuntu, where fcgid_proc_win.c is not used.
Perhaps, a proper solution is to make it possible to escape spaces or use
quotes in ScriptAlias. The documentation does not state that this is possible,
and the implementation in fcgid_proc_win.c clearly does not support that.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]