How to run Java program and get output in PHP?

mrmrmr

New Member
I'd like to run something like (in myProgram.sh):\[code\]java -cp whatever.jar com.my.program $1\[/code\]within PHP and read the output.So far I have something like:\[code\]$processOrderCommand = 'bash -c "exec nohup setsid /myProgram.sh ' . $arg1 . ' > /dev/null 2>&1 &"';exec($processOrderCommand);\[/code\]But what I'd really like is to be able to get the output of the java program within the PHP script and not just execute it as another thread. How can this be done?
 
Back
Top