c++ cgi app calling other program fails
I develop a c++ CGI program that runs under Windows and Linux.
This program calls another program like this:
system("otherProgram.exe arguments");
I also tried:
spawnl(_P_WAIT, "otherProgram.exe", "argument1", NULL);
This works fine in my debugger and in my Virtual Machine, but on my test 开发者_C百科server it doesn't work. The system call returns -1.
Any ideas why?
This is likely a permissions issue. By default your CGI application will be run as if by user nobody. The program you want to launch should be executable by "nobody".
Is the directory containing "otherProgram.exe" in one of the directories in your PATH environment variable in the test box? That is, does your operating system know how to find that program?
精彩评论