"grab results from a php exec() while the command is still running?" Code Answer

1

you should take a look at proc_open

after making the output stream non-blocking (with stream_set_blocking), you can read from it whenever you want without having your php-code blocked.

-edit- if you use

$result = exec('command > /path/to/file &');

it will run in the background and you can read the output in /path/to/file

By mp_loki on June 23 2022

Answers related to “grab results from a php exec() while the command is still running?”

Only authorized users can answer the Search term. Please sign in first, or register a free account.