I mean, if a php script/page is invoked by a browser and page load/execution is interrupted by user or by browser crash, does script execution continues on the server side?
+7
A:
yes, unless you call ignore_user_abort() first. http://php.net/manual/en/function.ignore-user-abort.php
Mike Sherov
2010-07-05 15:45:54
You may also change default behavior in config file: http://pl.php.net/manual/en/misc.configuration.php#ini.ignore-user-abort
Kamil Szot
2010-07-05 15:50:52
Great! Thanks a lot!
Riccardo
2010-07-05 15:50:57
@Riccardo, no problem!
Mike Sherov
2010-07-05 15:52:15
A:
Depends on ignore_user_abort(). But if you have some loop or poorly written code, it will run until script timeout / max execution time has been reached (~30 seconds).
Jason McCreary
2010-07-05 15:47:53
A:
You can test this very easily:
echo "sleeping 10 seconds...";
sleep(10); //close your browser at this point
error_log("i'm still here!");
Just check your web server error log for the output.
joeynelson
2010-07-05 15:56:09