Search code examples
phpbrowserdedicated-server

what happens on a running php exeutable when i close browser?


I run a very long in terms of execution time php code, I normally run it with mozzila, and do othr stuff and work with chrome meanwhile.

I wonder what happens to the running code and how when i close the browser or it crashes, since all code should already be executing on the server anyhow.


Solution

  • By default the PHP process gets torn down the next time it tries to send output to the client¹, although you can change this behavior by using ignore_user_abort. For additional related information, read the manual section on connection handling.

    ¹ Note that in the presence of output buffering by PHP or by the web server, "echoing something" does not necessarily equal "output is sent to the client"; see flush.