sweepy Posted April 7, 2008 Share Posted April 7, 2008 Hi, im trying to run an external program on my web server using exec. It works fine if I do not pass any arguments, but fails if i pass one or more arguments as below: $command = "mycommand.exe"; $output = array(); exec($command, $output, $ret); if ($ret == 0){ foreach ($output as $line) { echo "$line \n"; } } The above works fine and outputs the stdout from the program, but if I now change $command = "mycommand.exe arg1"; I get no output whatsoever, not even an error to the screen or output to any log. I've also tried using backticks, system and passthru but still get the same problem, and I've tried $command = "cmd.exe /C mycommand.exe arg1" Any ideas on what the problem is? Cheers Link to comment https://forums.phpfreaks.com/topic/99956-exec-wont-take-arguments/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.