Here is what I want to do: a PHP script(a.php) starts a background process from an executable(p1.exe written in other languages) which runs for several hours and produces a sequence of output, for example, 1,2,3... Subsequent page views of a.php get the output of p1 in order. Because the web server puts restricts on timeout of a PHP script, I have to access a.php repeatedly to read all the outputs of p1. For example, the second PV reads 1,2,3 and the third PV reads 4,5,6.
I tried popen to start a background process and read its output, witch worked well. But I don't know how to continue to read in next page views. I also found pcntl_fork(included in PCNTL extension) and thought I could start p1 in a child process witch continually reads p1 output and stores in $_SESSION for a.php(I'm not sure if this works). But the PCNTL extension is not available on Windows. Media, like via a file should work, but I'm looking for another way.
Any idea is appreciated.