How to check if a php script is still running

前端 未结 13 2558
鱼传尺愫
鱼传尺愫 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:48

    If you're having trouble checking for the PHP script directly, you can make a trivial wrapper and check for that. I'm not sufficiently familiar with Windows scripting to put how it's done here, but in Bash, it'd look like...

    wrapper_for_test_php.sh

    #!/bin/bash
    php test.php
    

    Then you'd just check for the wrapper like you'd check for any other bash script: pidof -x wrapper_for_test_php.sh

提交回复
热议问题