How to check if a php script is still running

前端 未结 13 2527
鱼传尺愫
鱼传尺愫 2020-12-15 12:02

I have a PHP script that listens on a queue. Theoretically, it\'s never supposed to die. Is there something to check if it\'s still running? Something like

13条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-15 13:02

    One possible solution is to have it listen on a port using the socket functions. You can check that the socket is still listening with a simple script. Even a monitoring service like pingdom could monitor its status. If it dies, the socket is no longer listening.

    Plenty of solutions.. Good luck.

提交回复
热议问题