If you're running Apache (1.3.x version) and mod_xmlrpc on Windows, there's a small change you should make to mod_xmlrpc.c.
In the function xmlrpc_exec, near the bottom, instead of:
child_pid=ap_call_exec(r, pinfo, program, env, 0);
ap_log_error(APLOG_MARK, APLOG_ERR, NULL, "execution of %s failed", r->filename);
exit(0);
return;
Otherwise, you'll blow a half a day pulling your hair out as I did.
Also, if you're CGI program is an exe, you don't need
the '.exe' extension.
For example, I have a program named msglogr.exe that I renamed msglogr and copied to e:\Program Files\Apache Group\Apache\xmlrpc\work per my xmlRpcLibrary directive in httpd.conf.
I can invoke it as http://localhost:80/RPC2 work.msglogr
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Per your suggestion, I tried: http://localhost:80/RPC2 work.msglogr.exe and it DID work.
The source code change had to do with the fact that mod_xmlrpc was always reporting 'execution failed'. I started to compare the code in xml_rpcexec with very similar code in mod_cgi, and I noticed they had the #ifdefined(WIN32) statement. Once I added the same directive to your code, everything worked. Otherwise, the code always dropped through to reporting an error.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you're running Apache (1.3.x version) and mod_xmlrpc on Windows, there's a small change you should make to mod_xmlrpc.c.
In the function xmlrpc_exec, near the bottom, instead of:
child_pid=ap_call_exec(r, pinfo, program, env, 0);
ap_log_error(APLOG_MARK, APLOG_ERR, NULL, "execution of %s failed", r->filename);
exit(0);
return;
Use:
child_pid=ap_call_exec(r, pinfo, program, env, 0);
#if defined(WIN32) || defined(OS2)
return (child_pid);
#else
ap_log_error(APLOG_MARK, APLOG_ERR, NULL, "execution of %s failed", r->filename);
exit(0);
return (0);
#endif
Otherwise, you'll blow a half a day pulling your hair out as I did.
Also, if you're CGI program is an exe, you don't need
the '.exe' extension.
For example, I have a program named msglogr.exe that I renamed msglogr and copied to e:\Program Files\Apache Group\Apache\xmlrpc\work per my xmlRpcLibrary directive in httpd.conf.
I can invoke it as http://localhost:80/RPC2 work.msglogr
Another (probably) solution (dosn't require modifications in src) is calling functions asis (with exe extention - "myfunc.exe").
Andrew
Hey Andrew,
Per your suggestion, I tried:
http://localhost:80/RPC2 work.msglogr.exe and it DID work.
The source code change had to do with the fact that mod_xmlrpc was always reporting 'execution failed'. I started to compare the code in xml_rpcexec with very similar code in mod_cgi, and I noticed they had the #ifdefined(WIN32) statement. Once I added the same directive to your code, everything worked. Otherwise, the code always dropped through to reporting an error.