PHP Script as... deamon

General discussions related to php

Moderators: macek, egami, gesf

User avatar
mike
New php-forum User
New php-forum User
Posts: 73
Joined: Sun May 04, 2003 4:26 am
Location: Athens
Contact:

PHP Script as... deamon

Postby mike » Mon Jul 28, 2003 1:38 am

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...

User avatar
swirlee
Moderator
Moderator
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Postby swirlee » Mon Jul 28, 2003 5:51 am

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.


Return to “PHP General”

Who is online

Users browsing this forum: No registered users and 1 guest