How to get list of running php scripts using PHP exec()?

前端 未结 4 1216

I need to know and kill if there is any processes running a specified PHP script. Is that possible to get list of processes running sample.php using exec() and a php script.

4条回答
  •  余生分开走
    2020-12-17 04:26

    It depends on lots of factors including OS, PHP version, etc., but you could try using signals to get a script to give you its name and then terminate if it matches. Or, have the script register its pid and then compare with running processes.

    http://stuporglue.org/handling-signals-in-php/

提交回复
热议问题