I have done stuff like this before, usually with AJAX, but there is another way... You can create a sort of 'server-push' arrangement - although it only works if output buffering is totally disabled, and is therefore incompatible with zlib etc.
I would suggest using popen() for the execution of the process, allowing you to use fgets() etc to catch the output in a 'live' way.
Before you execute the command, generate your HTML page and send everything apart from </body></html> (use flush() to be sure this has happened) - most modern browsers will happily render the page before the server closes the connection as long as they have recieved a renderable amount of content.
You can then push little bits of javascript to the browser as and when events occur.
eg.
// Generate HTML page and send to browser, and create a pointer to the external
// command using popen() here
// You will need alter the condition expression of this while loop I suspect, to make
// sure that you catch all output and don't die until the external process has finished
while (($line = fgets($pointer)) !== FALSE) {
print("<script>addEventToTextArea('$line');</script>");
flush();
}
pclose($pointer);
...with the JS function addEventToTextArea() looking something like...
function addEventToTextArea (eventStr) {
textArea = document.getElementById('MyTextArea');
textArea.value = textArea.value + eventStr;
}
I have had setups like this working nicely in the past, let me know if you want some more complicated code from a working example.