Cody Fendant has asked for the wisdom of the Perl Monks concerning the following question:
I have a command foobar which runs just fine from the command line as a normal user.
When I run foobar it normally takes about 5 seconds, then returns "success".
I want to run the command in a CGI script and print the "success" text back to the browser.
If I put $result = `foobar` into my CGI script, it finishes instantly (no 5-second wait) and $result is empty.
How do I troubleshoot this? If the script couldn't find foobar in the path, I would at least get something like "unknown command" back, right?
So the command is silently failing, perhaps because of permissions, because it's running as the www username? What can I do to figure out what's happening and how to get it to work?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Running a backticks command in a CGI script
by NetWallah (Canon) on Apr 14, 2013 at 05:18 UTC | |
by Cody Fendant (Hermit) on Apr 14, 2013 at 08:47 UTC | |
|
Re: Running a backticks command in a CGI script
by kcott (Archbishop) on Apr 14, 2013 at 06:02 UTC |