Summary: | mod_fcgid fails to spawn process in C:\Program Files | ||
---|---|---|---|
Product: | Apache httpd-2 | Reporter: | Florian Winter <flw> |
Component: | mod_fcgid | Assignee: | Apache HTTPD Bugs Mailing List <bugs> |
Status: | REOPENED --- | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 2.2.17 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All |
Description
Florian Winter
2012-02-29 12:50:53 UTC
This is either duplicating 52436 or shares the same root issue as 51194 *** This bug has been marked as a duplicate of bug 51194 *** Verified that this was the same root issue as 51194, see the patch attached to that ticket. Verified that php script paths and names containing spaces work correctly with that patch applied. This has not been resolved. After upgrading to Apache 2.4.9 and the latest modules without our own patch applied, the same problem still occurs. Snippet from httpd.conf: ScriptAlias /fcgid-bin/ "C:/Program Files (x86)/FotoWare/My Application/" <Location /fcgid-bin/> SetHandler fcgid-script </Location> Is it necessary to use any special syntax so that ScriptAlias respects the spaces? The problem is still the same. Tokenization of the command-line causes the executable path to be split. This happens in proc_spawn_process in fcgid_proc_win.c, except a different tokenization function is used now. A workaround (which only works if the FCGI script does not take any arguments) is as follows: /* Build wrapper args */ // HACK(flw): Whitespace handling is still broken when using ScriptAlias, so skip tokenization of the command-line //apr_tokenize_to_argv(cmdline, (char ***)&wargv, procnode->proc_pool); wargv = apr_palloc(procnode->proc_pool, 2 * sizeof(char*)); wargv[0] = cmdline; wargv[1] = NULL; I tried escaping spaces as "\ " in the ScriptAlias and Directory directives in httpd.conf. This only causes requests to fail with 403 Forbidden. Can it be that the paths in Directory and ScriptAlias are parsed differently? There is no official documentation anywhere about how paths with spaces must be escaped. I tried to learn about it in the code of apr_tokenize_to_argv, but it is C code cluttered with preprocessor macros and memory allocations, so I gave up (working with strings in C is hard. I guess that's why it's broken.../rant) |