PHP 8.5.0 Alpha 1 available for testing

Voting

: five minus zero?
(Example: nine)

The Note You're Voting On

eddi13
9 years ago
check whether the process is running. windows-linux
<?php
function isRunning($pid) {
$isRunning = false;
if(
strncasecmp(PHP_OS, "win", 3) == 0) {
$out = [];
exec("TASKLIST /FO LIST /FI \"PID eq $pid\"", $out);
if(
count($out) > 1) {
$isRunning = true;
}
}
elseif(
posix_kill(intval($prevPid), 0)) {
$isRunning = true;
}
return
$isRunning;
}
?>

<< Back to user notes page

To Top