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

后端 未结 9 1127
小蘑菇
小蘑菇 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条回答
  •  旧时难觅i
    2020-12-24 04:27

    If you can't use the (proper) init structure to do this (you're on shared hosting, etc.), use cron to run a script (it can be written in whatever language you like) every few minutes that checks to see if they're running, and restarts them if necessary.

提交回复
热议问题