PHPackages                             mozartk/process-finder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mozartk/process-finder

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mozartk/process-finder
======================

Get list of running processes by name or pid, supports windows and unix, macOS

v1.0.1(7y ago)1149[1 issues](https://github.com/mozartk/process-finder/issues)2MITPHPPHP &gt;=5.3.0

Since May 14Pushed 7y ago1 watchersCompare

[ Source](https://github.com/mozartk/process-finder)[ Packagist](https://packagist.org/packages/mozartk/process-finder)[ Docs](https://github.com/mozartk)[ RSS](/packages/mozartk-process-finder/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (3)Used By (2)

process-finder
==============

[](#process-finder)

[![Build Status](https://camo.githubusercontent.com/12c3e39ebea445326b5e520bdbce363c6dbc127b634894cd79b0f4b9f168cbe2/68747470733a2f2f7472617669732d63692e6f72672f6d6f7a6172746b2f70726f636573732d66696e6465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mozartk/process-finder?branch=master)[![](https://camo.githubusercontent.com/b3f9948a1be47f8310e5f1a2fae915a27b60f28ee1d9687c1395fdfe0f3ad869/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7068702d762f6d6f7a6172746b2f70726f636573732d66696e6465722e737667)](https://travis-ci.org/mozartk/process-finder?branch=master)[![Coverage Status](https://camo.githubusercontent.com/7725ef259688e241837070e1f8213c0947f5fd4092cbe4b7d6bf3ad79063d024/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d6f7a6172746b2f70726f636573732d66696e6465722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/mozartk/process-finder?branch=master)[![License MIT](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](https://opensource.org/licenses/MIT)[![OJD](https://camo.githubusercontent.com/c73bfc6dc3688bc6ab8cfb773cf67462c81146f9f2cdcffaa964f0234032b284/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4f4a442d6d6f7a6172746b2d677265656e2e737667 "WE ARE OJD")](OJDDEV.md)

This is fork version of [craftpip/process-handler](https://github.com/craftpip/process-handler).

Get list of running processes by name or pid, supports windows and unix, macOS

I struggled to find a library that returns the processes list for the operating system. My use case was to find if my spawned process was running or not.

Usage
-----

[](#usage)

```
// Include your autoload
require_once 'vendor/autoload.php';

use \mozartk\ProcessFinder\ProcessFinder;
use \Symfony\Component\Process\Process;

// Initialize your library
$processFinder = new ProcessFinder();

// Spawn a process and check if a process by its pid exists.
$symfonyProcess = new Process('ls');
$symfonyProcess->start();
$pid = $symfonyProcess->getPid(); // 8378

$process = $processFinder->getProcess($pid);
if($process){
    $name = $process->getName();
    $pid = $process->getPid();
    $mem_used = $process->getMemUsed();
    $cpu_time = $process->getCpuTime();
    $session = $process->getSession();
    $session_name = $process->getSessionName();
    $status = $process->getStatus();
    $username = $process->getUsername();
    $window_title = $process->getWindowTitle();
    $is_running = $process->isRunning();

    /*
    Examples
    returns the following on UNIX
    [0] => Array
            (
                [name] => [sh]
                [pid] => 8378
                [session_name] =>
                [session] => 6065
                [mem_used] => 0 KB
                [status] => RUNNING
                [username] => root
                [cpu_time] => 00:00:00
                [window_title] =>
            )

    returns the following on WINDOWS
    [0] => Array
            (
                [name] => cmd.exe
                [pid] => 6380
                [session_name] => Console
                [session] => 1
                [mem_used] => 3,504 K
                [status] => Unknown
                [username] => BONIFACE-PC\boniface
                [cpu_time] => 0:00:00
                [window_title] => N/A
            )
    */
}else{
    // process was not found.
}

// get all processes
$allProcesses = $processFinder->getAllProcesses();
```

Methods
-------

[](#methods)

```
$processFinder = new ProcessFinder();
$processFinder->getAllProcesses();
$processFinder->getProcess($pid);
$processFinder->isRunning($pid);
```

Installation
------------

[](#installation)

Run the composer command

```
composer require mozartk/process-finder
```

ProcessFinder can be installed with Composer by adding the library as a dependency to your composer.json file.

```
{
    "require": {
        "mozartk/process-finder": "~1.0"
    }
}
```

Copyright and license
---------------------

[](#copyright-and-license)

Made by mozartk.
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

This is fork version of [craftpip/process-handler](https://github.com/craftpip/process-handler).

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

2

Last Release

2914d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1d1b17ce3cfcfac7c39fe94ad3b438756c8e4a26e8739b825f94abfee7d2734f?d=identicon)[mozartk](/maintainers/mozartk)

---

Top Contributors

[![mozartk](https://avatars.githubusercontent.com/u/1418452?v=4)](https://github.com/mozartk "mozartk (13 commits)")

---

Tags

processpid existsprocess existsrunning processes

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mozartk-process-finder/health.svg)

```
[![Health](https://phpackages.com/badges/mozartk-process-finder/health.svg)](https://phpackages.com/packages/mozartk-process-finder)
```

###  Alternatives

[react/child-process

Event-driven library for executing child processes with ReactPHP.

34076.1M136](/packages/react-child-process)[cocur/background-process

Start processes in the background that continue running when the PHP process exists.

2971.9M12](/packages/cocur-background-process)[phpmentors/workflower

A BPMN 2.0 workflow engine for PHP

70652.9k4](/packages/phpmentors-workflower)[duncan3dc/fork-helper

Simple class to fork processes in PHP and allow multi-threading

73548.0k4](/packages/duncan3dc-fork-helper)[arara/process

Provides a better API to work with processes on Unix-like systems

16861.7k2](/packages/arara-process)[bluepsyduck/symfony-process-manager

A process manager for Symfony processes, able to run them in parallel.

10784.6k3](/packages/bluepsyduck-symfony-process-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
