note 95889 deleted from book.exec by danbrown
| From: | danbrown@php.net | Date: | Wed, 27 Jan 2010 14:34:49 +0000 |
| Subject: | note 95889 deleted from book.exec by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-165366@lists.php.net to get a copy of this message | ||
Note Submitter: bram.diederik
----
I'm looking for a way to check if a process is running. I cant find a good php method. I am now
using this function in my code. Not working in Windows
<?php
function is_running($PID) {
if (is_numeric($PID))
return exec("ps -p $PID >> /dev/null && echo \"1\" || echo
\"0\"");
return false;
}
?>