There's an exec and system command.
So to run a program from the prompt it'll be
exec("/path/app $id $ion $field", $outputArray, $returnValue);
Or something like that, depending on how your program accepts it's arguments. And the program must be executable by the apache user ie the "nobody" or "apache" users.
-Euan