Steve Dell
Steve Dell

Reputation: 605

Count number of processes running on Windows via PHP

Do you know if there is a way in Windows to count the number of processes running via PHP?

Any help would be greatly appreciated.

Upvotes: 0

Views: 712

Answers (1)

Illuminati
Illuminati

Reputation: 548

Yes, with a simple google search you can use this:

http://php.net/manual/en/function.win32-ps-list-procs.php

$processList = win32_ps_list_procs();
if($processList === false) {
    // Do error handling here. We use die() for example
    die('Failed to obtain the list of processes');
}
$count = count($processList);

Upvotes: 2

Related Questions