I am uploading a file via php move_uploaded_file
function and then the file is then taken as a parameter of a java program. while the java program is executing, it outputs the progress in the terminal. The output of the java program is input of a perl script which does the same.
I am executing all of them in my php web site as shell_exec functions and printing them on screen
echo "Running java ..... ";
$output=shell_exec("java -jar abc.jar ".( $_FILES['uploaded']['name']));
echo "<pre>$output</pre>";
echo "running perl .....";
$output=shell_exec("perl abc.pl outputfromjava.txt");
echo "<pre>$output</pre>";
The shell commands are running fine but the output from java and perl isn't displayed on my web site. I tried refreshing the page in my code after java and perl is executed but it then refreshes the upload too.
The output is now
Running java ....
Running Perl ....
How should I write my php so that the output is
Running Java...
Progress1 //from java output
progress2 //from java output
Running Perl....
Progress1 //from perl output
progress2 //from perl output
Thanks