使用php检测并输出特定程序是否正在运行
基本上,我想知道一种非常简单的方法,用于检查php脚本是否在我的nix盒上运行特定程序 比如:使用php检测并输出特定程序是否正在运行,php,linux,bash,output,Php,Linux,Bash,Output,基本上,我想知道一种非常简单的方法,用于检查php脚本是否在我的nix盒上运行特定程序 比如: <?php #some detection function here. if($detectprogram == 1){ echo("It's running."); } else{ echo("It's not running."); } ?> 也许你需要这个 exec("ps auxwww|grep sample.php|grep -v grep", $output); 资
<?php
#some detection function here.
if($detectprogram == 1){
echo("It's running.");
}
else{
echo("It's not running.");
}
?>
也许你需要这个
exec("ps auxwww|grep sample.php|grep -v grep", $output);
资料来源: