[lug] Running a PHP script as a daemon

Jason Vallery jason at vallery.net
Thu May 18 08:48:16 MDT 2006


No, cron wouldn't work in this case.  The socket is always open, except in
cases where some error has occurred (failed connection).  The inittab setup
I have going seems to be working well now.  I'll keep my fingers crossed
that the problems I was having before were flukes.

-Jason



On 5/18/06, George Sexton <gsexton at mhsoftware.com> wrote:
>
> Do you just need this to run something on a routine basis like every 10
> minutes?
>
> If so, have you considered running it in Apache, and using cron to
> schedule wget calls?
>
> Jason Vallery wrote:
> > Hi all,
> >
> > I've done some googling on this topic and I have come up short, I
> > thought I would throw it out here.  I have a php script that
> > essentially connects a socket to a remote server and listens, when it
> > receives data (XML) it processes it and stores it in the database.
> > Since this script needs to run all the time, what is the best way to
> > handle that?  I'd like a solution that I can setup to start on system
> > boot, and restart if for some reason PHP encounters a critical error
> > and crashes (connection drop for example).
> >
> > The server is running CentOS 4.3 and  PHP 5.0.4.
> >
> > Thoughts?
> >
> > Thanks
> > -Jason
>
> --
> George Sexton
> MH Software, Inc.
> Voice: +1 303 438 9585
> URL:   http://www.mhsoftware.com/
>
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us port=6667 channel=#colug
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20060518/d5034cd2/attachment.html>


More information about the LUG mailing list