PHPackages                             win32service/win32servicebundle - 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. win32service/win32servicebundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

win32service/win32servicebundle
===============================

Bundle for integrate the win32service/service-library into a Symfony Project

v2.0.4(1y ago)23.4k↓27.9%2MITPHPPHP ^8.0

Since Feb 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/win32service/Win32ServiceBundle)[ Packagist](https://packagist.org/packages/win32service/win32servicebundle)[ Docs](https://win32service.mactronique.fr/bundle.html)[ GitHub Sponsors](https://github.com/macintoshplus)[ RSS](/packages/win32service-win32servicebundle/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (10)Dependencies (18)Versions (15)Used By (0)

Win32ServiceBundle
==================

[](#win32servicebundle)

The bundle for use Service-Library and Win32Service PHP ext into a Symfony Project.

Install
=======

[](#install)

```
composer require win32service/win32servicebundle
```

Configure
=========

[](#configure)

Add file `config/win32service.yaml` with this content:

```
win32_service:
    windows_local_encoding: ISO-8859-15 # The windows local encoding for convert the string UTF-8 from configuration to the local encoding.
    logging_extra: # This configuration enable a processor for Monolog
      enable: false # Enable a processor for add the thread number into the extra fields
        channels: # The list of channels whom the processor add the thread number. If empty, the thread number is added for all channels.
         - ref1
    services:
      # Prototype
      -
        service_id: "" # The service id. If `thread_count` > 1, you can use `%d` to define the place of the thread number
        machine: "" # the machine name for this service.
        displayed_name: "" # The friendly name of the service. If `thread_count` > 1, you can use `%d` to define the place of the thread number
        script_path: ~ # the script name. If not defined, the integrated execute command is used.
        script_params: "" # the arguments for the script. if `thread_count` > 1, you can use `%d` to define the place of the thread number
        run_max: 1000 # number of loop before exit
        thread_count: 1 # the number of this service need to register. Use `%d` into `service_id`, `displayed_name` and `script_params` for contains the service number.
        description: "" # the service description
        delayed_start: false # If true the starting for the service is delayed
        exit: # Settings for the exit mode
          graceful: true # if false, the exit fire the recovery action
          code: 0 # If graceful is true, this value must not be 0
        user: # The User set on the service
          account: ~ # the account name
          password: ~ # the password
        recovery:
          enable: false # The recovery action is disabled
          delay: 60000 # The delay before run action (in millisecond)
          action1: 0 # The action for the first fail
          action2: 0 # The action for the second fail
          action3: 0 # The action for the next fail
          reboot_msg: "" # The message send to log if action is reboot the server
          command: ""  # The command to be execute if the action is 'run command'
          reset_period: 86400 # The period before reset the fail count (in minutes)
        dependencies: # The list of service depends
          - Netman # An example of dependency.

    messenger: # This configuration allow to set on Windows service the Symfony Messenger Consumer.
      # Prototype
      -
        user: # The User set on the service
          account:            ~ # the account name
          password:           ~ # the password
        receivers:            [] # Symfony Messenger transport consumed by the service
        machine:              '' # the machine name for this service.
        displayed_name:       ~ # Required, The friendly name of the service. If `thread_count` > 1, you can use `%d` to define the place of the thread number
        description:          '' # the service description
        thread_count:         1 # the number of this service need to register. Use `%d` into `service_id`, `displayed_name` and `script_params` for contains the service number.
        delayed_start:        false # If true the starting for the service is delayed
        limit:                0 # Reboot service after processed X messages
        failure-limit:        0 # Reboot service after X messages failure
        time-limit:           0 # Reboot service after X seconds
```

Define the runner
=================

[](#define-the-runner)

For each service, add a sub-class of `Win32Service\Model\AbstractServiceRunner`. The sub-class must be configured in service with the tag `win32service.runner` with an alias name corresponding to the `service_id`.

Exemple with one thread
-----------------------

[](#exemple-with-one-thread)

Extension configuration:

```
win32_service:
    windows_local_encoding: ISO-8859-1
    services:
      -
        service_id: "my_service"
        displayed_name: "My beautiful service"
        #[...]
```

Sub-class:

```
class MyRunner extends \Win32Service\Model\AbstractServiceRunner
{}
```

Service configuration :

```
services:
    MyRunner:
      tags:
        - { name: win32service.runner, alias: 'my_service'}
```

Exemple with many thread
------------------------

[](#exemple-with-many-thread)

Extension configuration:

```
win32_service:
    windows_local_encoding: ISO-8859-1
    services:
      -
        service_id: "my_service_%d"
        displayed_name: "My beautiful service"
        thread_count: 3
        #[...]
```

Sub-class:

```
class MyRunner extends \Win32Service\Model\AbstractServiceRunner
{}
```

Service configuration :

```
services:
    MyRunner:
      tags:
        - { name: win32service.runner, alias: 'my_service_%d'}
```

Manage the service
==================

[](#manage-the-service)

Open an administrator cmd window and go to your project.

Register the service
--------------------

[](#register-the-service)

For register all service, run this command:

```
php bin\console win32service:register
```

For register only one service (without thread number) run:

```
php bin\console win32service:register --service-name=my_service
```

For register only one service (with thread number) run:

```
php bin\console win32service:register --service-name=my_service_%d
```

Unregister the service
----------------------

[](#unregister-the-service)

For unregister all service, run this command:

```
php bin\console win32service:unregister
```

For unregister only one service (without thread number) run:

```
php bin\console win32service:unregister --service-name=my_service
```

For unregister only one service (with thread number) run:

```
php bin\console win32service:unregister --service-name=my_service_%d
```

Sent action at your services
----------------------------

[](#sent-action-at-your-services)

This command start all service (and all thread) defined in your project.

```
php bin\console win32service:action start
```

For sent the action for one service and all thread:

```
php bin\console win32service:action start --service-name=my_service_%d
```

For sent the action for one thread of one service (work same if the service has only one thread):

```
php bin\console win32service:action start --service-name=my_service_1
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 56.9% 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 ~175 days

Recently: every ~9 days

Total

13

Last Release

535d ago

Major Versions

v0.1.1 → v1.0.02022-09-29

1.x-dev → v2.0.0-RC12024-07-26

PHP version history (3 changes)v0.1.0-RC1PHP ^7.1.0 &lt;7.4.0

v0.1.1PHP ^7.1.0 &lt;8.0.0

v1.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/a15c90b32e75c27fc63f79357a914b4caa7af5fdb69a2e150341515ddececf95?d=identicon)[Macintosh\_plus](/maintainers/Macintosh_plus)

---

Top Contributors

[![macintoshplus](https://avatars.githubusercontent.com/u/814683?v=4)](https://github.com/macintoshplus "macintoshplus (62 commits)")[![jbcr](https://avatars.githubusercontent.com/u/51637606?v=4)](https://github.com/jbcr "jbcr (45 commits)")[![NeilWhitworth](https://avatars.githubusercontent.com/u/6729769?v=4)](https://github.com/NeilWhitworth "NeilWhitworth (2 commits)")

---

Tags

phpservice-workersymfonysymfony-bundlesymfony4win32win32servicewindowssymfonybundleserviceservice-managerwindowswin32service

###  Code Quality

TestsPHPUnit

Static AnalysisRector

### Embed Badge

![Health badge](/badges/win32service-win32servicebundle/health.svg)

```
[![Health](https://phpackages.com/badges/win32service-win32servicebundle/health.svg)](https://phpackages.com/packages/win32service-win32servicebundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[pentatrion/vite-bundle

Vite integration for your Symfony app

2755.3M13](/packages/pentatrion-vite-bundle)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)

PHPackages © 2026

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