PHP Script as... deamon

A

Anonymous

Guest
Has anyone ever developed a PHP Script to run as a deamon? I have created an infinite while loop with a 1-2sec delay and placed it on the background on linux using php as CGI.
(#php -q script &). The consuming mem is too low ... about 0.3% of total so the script is not very heavy for the server.

I want to know if someone has a different idea on this or something better than that...
 
Seems like a reasonable idea to me, though I'd be a little concerned about performance. Just make sure you unset() your variables whenever you have the opportunity to do so. There's a decent (if old) article at PHPBuilder about Using PHP As a Shell Scripting Language, which you might care to check out, but you might be way ahead of me.
 
Back
Top