PHPackages                             kevbaldwyn/php-fpm-monitor - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. kevbaldwyn/php-fpm-monitor

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

kevbaldwyn/php-fpm-monitor
==========================

Monitor and restart php-fpm with notification

01.4kPHP

Since Nov 15Pushed 10y ago1 watchersCompare

[ Source](https://github.com/kevbaldwyn/phpfpm-monitor)[ Packagist](https://packagist.org/packages/kevbaldwyn/php-fpm-monitor)[ RSS](/packages/kevbaldwyn-php-fpm-monitor/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Php Fpm Monitor
===============

[](#php-fpm-monitor)

This package can be configured to monitor php5-fpm through its built in ping and status pages. It can then restart php5-fpm if it detects a failure and also optionally notify you of the failure with the last successful status output.

It is not designed as a permanent solution for problems with php-fpm, more a tool to help you handle failure while the problems can be interrogated by notifying you of the state of the last success. Typically the problems might be a mis-configured fpm pool and the log of the last status before failure will hopefully help diagnose those issues.

Instalation
-----------

[](#instalation)

Install with composer:

1. Add to composer:

    "require": { ... "kevbaldwyn/php-fpm-monitor":"dev-master" ... }
2. Composer Update:

    $ composer update kevbaldwyn/php-fpm-monitor
3. Copy the yaml `config.example.yml` file to a convenient location and configure the options as you require. It should work without notifications out of the box.

Useage
------

[](#useage)

The package provides a binary which will be located in `vendor/bin/monitor`. Basic useage requires passing the config yaml file path to the command as the first argument. All other options are optional.

```
$ vendor/bin/monitor check /var/www/config.yml

```

Passing the help `-h` flag shows all options. To set the host and port to ping php-fpm for example:

```
$ vendor/bin/monitor check /var/www/config.yml -l http://example.com -p 80

```

The idea is that this command is then run from cron periodically to check the state of php-fpm and will automatically restart the service if it is down.

Php5-Fpm status and ping pages
------------------------------

[](#php5-fpm-status-and-ping-pages)

This tool requires the status and ping pages to be correctly setup. More info on this can be found here:

Failure Handlers
----------------

[](#failure-handlers)

There are 2 built in failure handlers : `KevBaldwyn\PhpFpmMonitor\FailureHandlers\PhpFpmRestart` which restarts php-fpm and `KevBaldwyn\PhpFpmMonitor\FailureHandlers\NotifyHipChat`. Both of these can be further configured in the yaml config.

To specify which FailureHandlers run you simply list the fully namespaced classes in the `restart_handlers` config array.

You can write your own handlers by implementing `KevBaldwyn\PhpFpmMonitor\OnFailureInterface`. This receives the following method call which contains the full config, as defined in the yaml file, and the last successful status response in json format.

```
public function handle(array $config, $lastSuccessStatus);

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/493d83b3d613f5d449f08b101e742fa85a28a272ab9cf0a73ca778464ad47a7b?d=identicon)[kevbaldwyn](/maintainers/kevbaldwyn)

---

Top Contributors

[![kevbaldwyn](https://avatars.githubusercontent.com/u/2512883?v=4)](https://github.com/kevbaldwyn "kevbaldwyn (9 commits)")

### Embed Badge

![Health badge](/badges/kevbaldwyn-php-fpm-monitor/health.svg)

```
[![Health](https://phpackages.com/badges/kevbaldwyn-php-fpm-monitor/health.svg)](https://phpackages.com/packages/kevbaldwyn-php-fpm-monitor)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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