PHP Background Processes

Well, you can use “ignore_user_abort(true)” So the script will continue to work (keep an eye on script duration, perhaps add “set_time_limit(0)”) But a warning here: You will not be able to stop a script with these two lines: ignore_user_abort(true); set_time_limit(0); Except you can directly access the server and kill the process there! (Been there, done … Read more

How to run a background task in a servlet based web application?

Your problem is that you misunderstand the purpose of the servlet. It’s intented to act on HTTP requests, nothing more. You want just a background task which runs once on daily basis. EJB available? Use @Schedule If your environment happen to support EJB (i.e. a real Java EE server such as WildFly, JBoss, TomEE, Payara, … Read more