简体   繁体   English

PHP检查外部过程

[英]Php check on external process

I'm trying to add some php to my website to accomplish a task that would be outlined as: 我正在尝试向我的网站添加一些php,以完成一项将概述为的任务:

check if foo.exe is running
if foo.exe is running display run.png
else display not.png

check if bar.exe is running
if foo.exe is running display run.png
else display not.png

The problem I'm having is that nothing I find online can even begin to tell me what methods I should be looking into. 我遇到的问题是,我在网上找不到的任何东西甚至都无法开始告诉我应该考虑的方法。 I've spent weeks learning PHP from sites like Codecademy, w3schools, etc. and none of them will give me the slightest clue on how to accomplish this. 我花了数周的时间从Codecademy,w3schools等网站学习PHP,但没有一个丝毫可以为我提供有关如何实现此目标的线索。

Ok, so what I did (thanks to suggestions) was this: 好的,所以我所做的(由于建议)是:

<?php
                $output = shell_exec('wmic process list brief | find /i "ventrilo_srv.exe"');
                echo $output;
            ?>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM