Answer the question
In order to leave comments, you need to log in
Can a PHP script be interrupted when the browser is closed?
Good afternoon!
The site runs a function once a day, when entering the page, sometimes it can work for a long time 10-30 seconds, at which time the user can close the page or browser
In the near future, this script will be hung on cron, but at the moment the script sometimes does not work correctly, can the PHP script be interrupted when the browser is closed?
Answer the question
In order to leave comments, you need to log in
Yes, when the connection with the client is interrupted, the work of a long script is interrupted, so that this does not happen, put it at the beginning of the script:
In this case, the script will always work to the end even if the browser was closed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question