I am trying to run a java program in the background using php. I am able to the run the program but the page doesn't load till java program completes executing.
I am able to run shell scripts in the background using php. But if i give the same command for java, it doesn't run in the background.
$command = "java hello";
$outputfile = "out1";
$pidfile = "out2";
exec(sprintf("%s > %s 2>&1 & echo $! >> %s", $command, $outputfile, $pidfile));
How can i run the program in the background?