0

基本上我想知道一个非常简单的方法来制作一个php脚本检查一个特定的程序是否在我的nix盒子上运行。

就像是 :

<?php

#some detection function here.

if($detectprogram == 1){ 
echo("It's running.");
}
else{
echo("It's not running.");
}
?>

或者即使我必须通过 .sh(我已经这样做)和 -outputphp /path/to/htdocs/ 来执行程序。或类似的。谢谢。

4

1 回答 1

0

也许你需要这个?

exec("ps auxwww|grep sample.php|grep -v grep", $output);

资料来源:如何使用 PHP exec() 获取正在运行的 php 脚本列表?

于 2013-10-31T23:37:48.810 回答