How to check if a php script is still running

前端 未结 13 2536
鱼传尺愫
鱼传尺愫 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 12:39

    Simple bash script

    #!/bin/bash
    while [true]; do
        if ! pidof -x script.php;
        then
            php script.php &
        fi
    done
    

提交回复
热议问题