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(1mo ago)11MITPHPPHP ^8.3CI passing

Since Mar 10Pushed 1mo 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 1mo ago

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

41

—

FairBetter than 88% of packages

Maintenance94

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

59d 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

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[temporal/sdk

Temporal SDK

4002.2M18](/packages/temporal-sdk)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[illuminate/process

The Illuminate Process package.

44699.5k65](/packages/illuminate-process)[statamic/cli

Statamic CLI Tool

7587.7k](/packages/statamic-cli)

PHPackages © 2026

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