execution - When will "while(1) { sleep(1); }" die in PHP? -


i wondering today whether or not script terminated when user exit webpage (while loading). turns out yes, unless set otherwise. so, in mind, when script finish?

// don't stop script when user closes window ignore_user_abort();  set_time_limit(0);  // infinite loop (normally aborted when user closes window) while(1) {   sleep(1);   } 

my best bet is, when php and/or server turned off/on. however, in production system, can in critical situations. question is, when script ended? mean without action being taken end specific script. wouldn't same script without sleep() potential hazard hosting companies? set out 1 of them expensive operation , server 100% script.

here thinking of:

  1. apache restarted - hosting companies if reaches cpu usage limit.
  2. some hosting companies limit processes x number of processes @ same time (ex: 1and1). once 3 people access site, else error 500.

some hosting have ignore_user_abort/set_time_limit in disabled_functions list same reason.

update: changed many some. guess hosts use pretty different people use.


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -