public function isRunning($pid)
    {
        $output = $exitCode = null;
        exec(sprintf("ps %d", $pid), $output, $exitCode);
        return $exitCode === 0;
    }
public function isRunning($pid)
    {
        $output = $exitCode = null;
        exec(sprintf("ps %d", $pid), $output, $exitCode);
        return $exitCode === 0;
    }
public function isRunning ( $ pid ) { $ output = $ exitCode = null ; exec ( sprintf ( "ps %d" , $ pid ) , $ output , $ exitCode ) ; return $ exitCode === 0 ; }
Check process using the "ps" command.

@param int $pid
@return boolean
Check process using the ps command .