PHPackages                             abdulbasset/nssm-php - 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. abdulbasset/nssm-php

ActiveLibrary

abdulbasset/nssm-php
====================

PHP Wrapper for nssm - the Non-Sucking Service Manager

v1.0.2(1w ago)11MITPHPPHP ^8.3CI passing

Since Mar 10Pushed 1w agoCompare

[ Source](https://github.com/Abdulbasset/nssm-php)[ Packagist](https://packagist.org/packages/abdulbasset/nssm-php)[ RSS](/packages/abdulbasset-nssm-php/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (4)Used By (0)

NSSM PHP
========

[](#nssm-php)

A lightweight PHP wrapper for [NSSM](https://nssm.cc/) (the Non-Sucking Service Manager). This package allows you to manage Windows services using PHP by providing a fluent interface to interact with the NSSM binary.

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

[](#installation)

You can install the package via composer:

```
composer require abdulbasset/nssm-php
```

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- [NSSM](https://nssm.cc/download) binary must be available in your system's PATH, or you can specify the path to the binary manually.

Usage
-----

[](#usage)

### Basic Service Management

[](#basic-service-management)

```
use Abdulbasset\NssmPhp\Nssm;

$nssm = new Nssm('MyService');

// Start the service
$nssm->start();

// Stop the service
$nssm->stop();

// Restart the service
$nssm->restart();
```

### Installing and Removing Services

[](#installing-and-removing-services)

```
use Abdulbasset\NssmPhp\Nssm;

$nssm = new Nssm('MyService');

// Install service (with application path and arguments)
// The bin() method sets the path to the executable (e.g., php.exe)
$nssm->bin('C:\path\to\your\app.exe')->install('arg1', 'arg2');

// Remove service
$nssm->remove();
```

### Configuring Service Parameters

[](#configuring-service-parameters)

You can set various service parameters using the `set` method. It provides a fluent interface to set multiple parameters at once:

```
use Abdulbasset\NssmPhp\Nssm;
use Abdulbasset\NssmPhp\Startup;
use Abdulbasset\NssmPhp\NssmSet;

$nssm = new Nssm('MyService');

$nssm->set(function (NssmSet $set) {
    $set->displayName('My Custom Service Name')
        ->description('This is a custom service managed by PHP')
        ->startup(Startup::Automatic)
        ->appDirectory('C:\path\to\app')
        ->output('C:\path\to\logs\stdout.log')
        ->error('C:\path\to\logs\stderr.log');
});
```

### Get Service Status

[](#get-service-status)

The `status()` method returns an instance of the `Abdulbasset\NssmPhp\Status` enum, or `null` if the status is unknown.

```
use Abdulbasset\NssmPhp\Nssm;
use Abdulbasset\NssmPhp\Status;

$nssm = new Nssm('MyService');
$status = $nssm->status();

if ($status === Status::Running) {
    echo "Service is running!";
}

// Convenient helper methods:
if ($status?->running()) { ... }
if ($status?->pending()) { ... } // Returns true for StartPending or StopPending
if ($status?->exists()) { ... }  // Returns true if the service exists (not NotFound)
```

### Custom NSSM Binary Path

[](#custom-nssm-binary-path)

If `nssm` is not in your system's PATH, you can specify its location during instantiation or using the `nssm()` method:

```
use Abdulbasset\NssmPhp\Nssm;

// During instantiation
$nssm = new Nssm('MyService', 'C:\path\to\nssm.exe');

// Or using the nssm() method
$nssm->nssm('C:\path\to\nssm.exe');
```

Testing
-------

[](#testing)

The package uses [Pest](https://pestphp.com/) for testing.

```
composer test
```

License
-------

[](#license)

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

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance98

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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 ~0 days

Total

3

Last Release

10d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3628cdff9032bab6d7a604c8110e340b657223f1764a564eeedfbb0a0d1f3377?d=identicon)[Abdulbasset](/maintainers/Abdulbasset)

---

Top Contributors

[![Abdulbasset](https://avatars.githubusercontent.com/u/27578098?v=4)](https://github.com/Abdulbasset "Abdulbasset (5 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/abdulbasset-nssm-php/health.svg)

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

###  Alternatives

[illuminate/console

The Illuminate Console package.

12943.4M4.3k](/packages/illuminate-console)[maba/webpack-bundle

Bundle to Integrate Webpack to Symfony

122268.2k4](/packages/maba-webpack-bundle)[illuminate/process

The Illuminate Process package.

44658.7k46](/packages/illuminate-process)[spatie/pixelmatch-php

Compare images using PHP

5677.9k3](/packages/spatie-pixelmatch-php)

PHPackages © 2026

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