Re: Echo from stream_select as output is generated by child process?
| From: | Christoph Becker | Date: | Thu, 05 Jun 2014 23:13:11 +0000 |
| Subject: | Re: Echo from stream_select as output is generated by child process? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-323395@lists.php.net to get a copy of this message | ||
Mike Kilmer wrote:
> I'm using proc_open to call a python script.
>
> The (python) child process takes about a minute to run, and when run
> from the command line it prints results as they are completed.
>
> With the php script, it just prints them all when it's complete.
>
> Is there a way to return the python output to the browser in real
> time?
Have you tried running the PHP script from the command line? It might
be possible that the PHP script echoes the output of the Python script
"immediately", but that PHP's output is buffered by the webserver or
somehow "delayed" by the browser.
> The full script is posted on StackOverflow, and what I think are the
> relevant segments are below:
It might be useful to post a link to the StackOverflow topic.
--
Christoph M. Becker