How to restart the script or you can initiate it from the beginning in the background?

Hello! There is such task, you need to restart the script when performing certain tasks in the background, for example if the user closed the page.
I understand that you want to use ignore_user_abort

Now I use for restart: <meta http-equiv="refresh" content="0; url=/test">

And how out-of-browser to accomplish this?
June 14th 19 at 18:26
2 answers
June 14th 19 at 18:28
If the script started on the http, let it continue running. It should end after a few seconds (and a long script to run via http - it lamerstvo) or he will die early while trying to output to the screen.

If a long pending job in the queue and has already started its processing in the console, it is possible to determine whether the page is closed upon disconnection from a socket server and send the event to the console script.
I am LAMER) - miller_Shanahan commented on June 14th 19 at 18:31
June 14th 19 at 18:30
Solved the problem using the PHP functiongoto

Find more questions by tags PHP