PHP Script as... deamon

General discussions related to php

Moderators: egami, macek, gesf

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

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...
11:16am up 404 days, 2 users, load average: 148.68, 143.45, 132.6

Mike Vassileiou
[Systems Administrator / PHP Developer]

PHP/MySQL Manual:

User avatar
Posts: 2257
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

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.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests