PHPackages                             jalallinux/php-pm2 - 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. [CLI &amp; Console](/categories/cli)
4. /
5. jalallinux/php-pm2

ActiveLibrary[CLI &amp; Console](/categories/cli)

jalallinux/php-pm2
==================

Manage pm2 process in php

1.3.0(3y ago)181.9k↓66.7%4[2 PRs](https://github.com/jalallinux/php-pm2/pulls)MITPHPPHP ^7.4|^8.0|^8.1|^8.2

Since Jan 15Pushed 1y ago2 watchersCompare

[ Source](https://github.com/jalallinux/php-pm2)[ Packagist](https://packagist.org/packages/jalallinux/php-pm2)[ Docs](https://github.com/jalallinux/php-pm2)[ Fund](https://reymit.ir/jalallinux)[ GitHub Sponsors](https://github.com/jalallinux)[ RSS](/packages/jalallinux-php-pm2/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (6)Dependencies (2)Versions (9)Used By (0)

[![](.github/pm2-logo.png)](https://github.com/Unitech/pm2)[![Latest Version on Packagist](https://camo.githubusercontent.com/ff382f0e740e59c29d980af531cc3875fe7c4431e669aec7ac1f8d962a180aa3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a616c616c6c696e75782f7068702d706d322e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jalallinux/php-pm2)[![Tests](https://github.com/jalallinux/php-pm2/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/jalallinux/php-pm2/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/306332cdd6576a6543d87c2e320e0a89a3c3207b9046c648c58e39830983a99c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a616c616c6c696e75782f7068702d706d322e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jalallinux/php-pm2)

Use and Manage **PM2** in php
-----------------------------

[](#use-and-manage-pm2-in-php)

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

[](#installation)

You can install the package via composer:

```
composer require jalallinux/php-pm2
```

Usage
-----

[](#usage)

### Pm2

[](#pm2)

- Full name: \\JalalLinuX\\Pm2\\Pm2

### list [❓](https://pm2.keymetrics.io/docs/usage/quick-start/#list-managed-applications)

[](#list-question)

Fetch list all running applications

```
pm2()->list(string $sortField = 'name', bool $desc = true): array
```

**Parameters:**

ParameterTypeDescription`sortField`**string**Sort field: `name, id, pid, memory, cpu, status, uptime``desc`**bool**Sort order is descending---

### link ❓

[](#link-question)

Connect your server to your dashboard and start collecting metrics

```
pm2()->link(string $publicKey, string $secretKey, string|null $machineName = null): bool
```

**Parameters:**

ParameterTypeDescription`publicKey`**string**PM2 account `PUBLIC_KEY``secretKey`**string**PM2 account `SECRET_KEY``machineName`**?string**Machine name on the dashboard---

### unlink ❓

[](#unlink-question)

Disconnect your server from your metrics dashboard

```
pm2()->unlink(): bool
```

---

### start [❓](https://pm2.keymetrics.io/docs/usage/quick-start/#start-an-app)

[](#start-question)

Start command with specifics options or start a `ecosystem.config.js`

```
pm2()->start(string $command = null, array $options = []): bool
```

**Parameters:**

ParameterTypeDescription`command`**?string**Command to run in pm2`options`**array**Options to start pm2 command [Guide](https://pm2.keymetrics.io/docs/usage/quick-start/#start-an-app) like `['name' => 'process-1', 'no-autorestart']`---

### findBy [❓](https://pm2.keymetrics.io/docs/usage/process-management/#showing-application-metadata)

[](#findby-question)

Find specific process

```
pm2()->findBy(string $key, string $value): \JalalLinuX\Pm2\Structure\Process|null
```

**Parameters:**

ParameterTypeDescription`key`**string**Key of property to find process`value`**string**Value of key---

### kill

[](#kill)

kill daemon

```
pm2()->kill(): bool
```

---

### pid

[](#pid)

Fetch pid of specific process

```
pm2()->pid(string $name): int|null
```

**Parameters:**

ParameterTypeDescription`name`**string**Name of process---

### flush [❓](https://pm2.keymetrics.io/docs/usage/log-management/#flushing-logs)

[](#flush-question)

Empty all log files

```
pm2()->flush(): bool
```

---

### update [❓](https://pm2.keymetrics.io/docs/usage/update-pm2/#process-to-update-pm2)

[](#update-question)

Update in memory pm2

```
pm2()->update(): mixed
```

---

### stopAll [❓](https://pm2.keymetrics.io/docs/usage/process-management/#stop)

[](#stopall-question)

Stop all processes

```
pm2()->stopAll(): bool
```

---

### restartAll [❓](https://pm2.keymetrics.io/docs/usage/process-management/#restart)

[](#restartall-question)

Restart all processes

```
pm2()->restartAll(): bool
```

---

### deleteAll [❓](https://pm2.keymetrics.io/docs/usage/process-management/#delete)

[](#deleteall-question)

Will stop and delete all processes from pm2 list

```
pm2()->deleteAll(): bool
```

---

### stop [❓](https://pm2.keymetrics.io/docs/usage/process-management/#stop)

[](#stop-question)

Stop specific process

```
pm2()->stop(string $idOrName): bool
```

**Parameters:**

ParameterTypeDescription`idOrName`**string**Id or name of process---

### restart [❓](https://pm2.keymetrics.io/docs/usage/process-management/#restart)

[](#restart-question)

Restart specific process

```
pm2()->restart(string $idOrName): bool
```

**Parameters:**

ParameterTypeDescription`idOrName`**string**Id or name of process---

### delete [❓](https://pm2.keymetrics.io/docs/usage/process-management/#delete)

[](#delete-question)

Delete specific process

```
pm2()->delete(string $idOrName): bool
```

**Parameters:**

ParameterTypeDescription`idOrName`**string**Id or name of process---

### save [❓](https://pm2.keymetrics.io/docs/usage/startup/#saving-the-app-list-to-be-restored-at-reboot)

[](#save-question)

Freeze a process list for automatic respawn

```
pm2()->save(bool $force = true): bool
```

**Parameters:**

ParameterTypeDescription`force`**bool**Force save list---

### logOut [❓](https://pm2.keymetrics.io/docs/usage/log-management/#log-views)

[](#logout-question)

Display all processes output logs

```
pm2()->logOut(string $idOrName = null, int $lines = 100): string
```

**Parameters:**

ParameterTypeDescription`idOrName`**?string**Id or name of process`lines`**int**To dig in older logs---

### logErr [❓](https://pm2.keymetrics.io/docs/usage/log-management/#log-views)

[](#logerr-question)

Display all processes error logs

```
pm2()->logErr(string $idOrName = null, int $lines = 100): string
```

**Parameters:**

ParameterTypeDescription`idOrName`**?string**Id or name of process`lines`**int**To dig in older logs---

### startup [❓](https://pm2.keymetrics.io/docs/usage/quick-start/#setup-startup-script)

[](#startup-question)

Generate an active startup script

```
pm2()->startup(): bool
```

---

### version ❓

[](#version-question)

Fetch installed pm2 version

```
pm2()->version(): string
```

---

### install [❓](https://pm2.keymetrics.io/docs/usage/update-pm2/#process-to-update-pm2)

[](#install-question)

Install **PM2** (Requirements: `node`, `npm`)

```
pm2()->install(string $version = 'latest'): false|string|null
```

**Parameters:**

ParameterTypeDescription`version`**string**Specific version---

### isInstall

[](#isinstall)

Check if the **PM2** is installed

```
pm2()->isInstall(bool $forceInstall = false, string $version = 'latest'): bool
```

**Parameters:**

ParameterTypeDescription`forceInstall`**bool**Install pm2 if is not installed`version`**string**Specific versionTesting
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [JalalLinuX](https://github.com/jalallinux)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 78.5% 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 ~30 days

Recently: every ~38 days

Total

6

Last Release

1103d ago

Major Versions

0.2.2 → 1.0.02023-01-15

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/37062636?v=4)[JalalLinuX](/maintainers/jalallinux)[@jalallinux](https://github.com/jalallinux)

---

Top Contributors

[![jalallinux](https://avatars.githubusercontent.com/u/37062636?v=4)](https://github.com/jalallinux "jalallinux (51 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (6 commits)")

---

Tags

jalallinuxphp-pm2

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/jalallinux-php-pm2/health.svg)

```
[![Health](https://phpackages.com/badges/jalallinux-php-pm2/health.svg)](https://phpackages.com/packages/jalallinux-php-pm2)
```

###  Alternatives

[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24726.4M22](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

13045.3M6.2k](/packages/illuminate-console)[winbox/args

Windows command-line formatter

20718.9k21](/packages/winbox-args)

PHPackages © 2026

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