显示进度并等到在PHP中执行exec()函数

I have written a PHP script to execute a program using exec() function. It usually take 30 seconds to 5 minutes to execute the program, depends on the input given. During long time of program execution, the web page seems hang on (freeze). Can't able to determine the time for execution or whether the program is still running or terminated.

exec("compile.exe -in data.csv -format 5 -out report.html");

I tried to execute the program using popen() and pclose() function. It executes in background. Again, I can't able to determine the time for execution or whether the program is still running or terminated. But, the web page does not hang on.

pclose(popen("start /B compile.exe -in data.csv -format 5 -out report.html", "r"));

I just want to display a text message or image till successful program execution to show that the program is still running.