Page 1 of 1

Is there a way to run background tasks in PHP ?

Posted: Thu Jul 16, 2009 9:11 am
by vorius
I was wondering if I could kick off some background task in a separate thread on server start ?

In my particular situation, I would use this so my web app would generate an e-mail every week at a specific time, without me having to manually make a request to any page.

Is this possible?

Re: Is there a way to run background tasks in PHP ?

Posted: Thu Jul 16, 2009 9:22 am
by onion2k
Use cron (on unix) or Windows Task Scheduler (on Windows) to call the script.

Re: Is there a way to run background tasks in PHP ?

Posted: Thu Jul 16, 2009 9:30 am
by alex.barylski
You might also invoke the script and use something like the technique in here?

http://ca3.php.net/manual/en/function.i ... -abort.php