Php realizes background operation, and notifies the foreground feedback after the operation.

  node.js, question

At present, php is used to execute scripts, but if the foreground page is closed, the script execution will be terminated, so I hope to switch to background operation.

There is another one that can be run at the front desk, but provides the running progress, such as the current real-time update of the execution status, such as 80% has been executed, and then prompts the completion information after 100% is completed.

For example, to realize video transcoding, we are currently transcoding, and then we hope to transcode in the background without affecting the foreground operation.
The other one takes up the front desk operation, but it can tell the front desk that transcoding is still in progress, and how much is not transcoded.

In addition, we need some methods that are more convenient to support in windows environment.

Video transcoding takes a long time and should not block the PHP-FPM process, so it should be handled asynchronously by another process:
pclose(popen('php /path/to/task.php &', 'r'));
Script task.php inside Calls Linux Commandmencoder/ffmpeg/imagemagick(convert)Processing multimedia files,
A piece of data is inserted into the database task list to record the status progress of the task for front-end AJAX inspection.