I would like to run a shell command that runs a process for a very long time, and outputs text while it is executing. This command is run using nohup in the background.
I would like to launch this command in php using shell_exec
, but I would like to know the best way to capture the output of this command while it is executing so that my php shows output while it is executing and does not wait indefinitely until the process terminates to show the output.
Example:
shell_exec(nohup ./program.sh &)