PHPackages                             lantongxue/php-nohup - 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. lantongxue/php-nohup

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

lantongxue/php-nohup
====================

A library to run a command in the background, it will return the process's pid, and get it's is running status anytime in the another process, and can be stoped anytime. It support Windows, Linux and Mac osx.

1.0.1(5y ago)115.1k↓40.4%[1 issues](https://github.com/lantongxue/php-nohup/issues)MITPHP

Since Dec 7Pushed 5y ago1 watchersCompare

[ Source](https://github.com/lantongxue/php-nohup)[ Packagist](https://packagist.org/packages/lantongxue/php-nohup)[ RSS](/packages/lantongxue-php-nohup/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

php-nohup
=========

[](#php-nohup)

A library to run a command in the background, it will return the process's pid, and get it's is running status anytime in the another process, and can be stoped anytime.

suport these system:

- Windows
- Linux
- Mac osx

Document Language

- English
- [简体中文](README_zh.md)

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

[](#installation)

Install via composer:

`compoer require lantongxue/nohup`

Usage
-----

[](#usage)

#### Run a script background

[](#run-a-script-background)

**Look, so easy!**

```
use lantongxue\nohup\Nohup;

$process = Nohup::run('sleep 5');
```

It will be running in the background for 5 seconds.

But, it can be stoped any time:

```
//...
$process->stop();
```

It stoped now!

Get the pid : `$process->getPid()`, It will return the real pid in both window and \*inx system

Get it's running status with the function `$process->isRunning()`:

```
use lantongxue\nohup\Nohup;

$process = Nohup::run('sleep 5');
while ($process->isRunning()) {
    echo '.';
    sleep(1);
}
echo "Done.\n";
```

*output*: `.....Done.`

#### Create process from known pid ($pid)

[](#create-process-from-known-pid-pid)

```
use lantongxue\nohup\Process;

$process = Process::loadFromPid($pid);
//or
$process = new Process($pid);

if ($process->isRunning()) {
    $process->stop();
}
```

#### Method:

[](#method)

`Nohup::run($commandLine, $outputFile, $errorFile)`

- `$commandLine`: string, the command will be run.
- `$outputFile`: string, the file path where to save output content.
- `$errlogFile`: string, the file path where to save error message.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Unknown

Total

1

Last Release

1989d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20817666?v=4)[kali](/maintainers/lantongxue)[@lantongxue](https://github.com/lantongxue)

---

Top Contributors

[![lantongxue](https://avatars.githubusercontent.com/u/20817666?v=4)](https://github.com/lantongxue "lantongxue (3 commits)")

### Embed Badge

![Health badge](/badges/lantongxue-php-nohup/health.svg)

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

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.1k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[seld/cli-prompt

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

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)[codedungeon/php-cli-colors

Liven up you PHP Console Apps with standard colors

10210.1M26](/packages/codedungeon-php-cli-colors)

PHPackages © 2026

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