1

I've built a looping script that i want to keep it running in the background.

The issue is that when i run it via the browser, it works fine but once i stop loading the page, the script stops/exists, i know that's pretty normal and makes sense, but how can i run a specific PHP script endlessly in the background?

It would be great if there is function in php that runs an other script but it goes on instead of waiting for it.

CodeOverload
  • 47,274
  • 54
  • 131
  • 219

2 Answers2

1

You are probably looking for:

Rusty Fausak
  • 7,355
  • 1
  • 27
  • 38
0

It is possible to run your script from command line as a process in background. Look here Run php script as daemon process or look at http://pear.php.net/package/System_Daemon that could help you to make it work :)

Web server kills your script because when user going on another site, server needs to spawn new PHP process for example and close older one.

Community
  • 1
  • 1
kkszysiu
  • 537
  • 2
  • 8