PHP Classes

PHP System Process List: Retrieve the processes running on the system

Recommend this page to a friend!
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 53%Total: 480 All time: 5,934 This week: 113Up
Version License PHP version Categories
process-list 1.0.0BSD License5.5PHP 5, System information, Unix, Windows


This class can retrieve the processes running on the system.

It can perform queries on the current OS to retrieve the list of processes independently of the OS.

The class objects can be iterated like an array, so you can get each process id, command name and parameters, CPU time, start time, title and tty, and children processes.

The process list can be retrieved again using the Refresh function.

It uses WMI queries on Windows and the POSIX call on Linux and Unix like systems.

Innovation Award
PHP Programming Innovation award nominee
October 2016
Number 3

Prize: One subscription to the PDF edition of the PHP Architect magazine
Processes are programs running on the current computer operating system.

Different systems manage and access the data of each process in different ways.

This class provides a platform independent solution to retrieve the list of processes and their details running either on Windows or Linux and other Unix-like systems.

Manuel Lemos
Picture of Christian Vigh
  Performance   Level  
Name: Christian Vigh <contact>
Classes: 32 packages by
Country: France France
Age: 57
All time rank: 13810 in France France
Week rank: 10 Up1 in France France Up
Innovation award
Innovation award
Nominee: 20x

Winner: 3x



        This example demonstrates the use of the ProcessList class.
        It works the same way for both Windows and Unix platforms.


    // This package requires the Wmi package for Windows platforms :
    // A version of this package is provided here for convenience, but it may not be the latest release.
require_once ( 'Wmi.phpclass' ) ;

    require_once (
'ProcessList.phpclass' ) ;

    if (
php_sapi_name ( ) != 'cli' )
        echo (
"<pre>" ) ;

// Get the process list and print it
$ps = new ProcessList ( ) ;
    foreach (
$ps as $process )
print_r ( $process ) ;
        echo (
"\n" ) ;

  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example Example script
Plain text file ProcessList.phpclass Class Class source
Accessible without login Plain text file Doc. Documentation
Plain text file Wmi.phpclass Class Class source 9KB
Downloadprocess-list-2016-10-24.tar.gz 8KB
Install with ComposerInstall with Composer
Needed packages  
Class DownloadWhy it is needed Dependency
Windows PHP WMI Class Download .zip .tar.gz Required on Windows platforms Conditional
 Version Control Unique User Downloads Download Rankings  
This week:0
All time:5,934
This week:113Up
 User Ratings  
 All time