What's the best way to keep a PHP script running as a daemon?

后端 未结 9 1128
小蘑菇
小蘑菇 2020-12-24 03:37

What is the best way to keep a PHP script running as a daemon, and what\'s the best way to check if needs restarting.

I have some scripts that need to run 24/7 and f

9条回答
  •  借酒劲吻你
    2020-12-24 04:27

    TBH, PHP probably isn't the best tool for this, really not what it was designed for. I've heard of memory leaks and other bad things happening when you try this. Also bear in mind PHP only has a finite amount of resource ids (for file handles, db connections ect) per execution of a script.

    Be better of using something else, maybe python or perl, though I don't have any real experience writing these sorts of apps, but I do know PHP isn't right for what your trying to do.

提交回复
热议问题