PHPackages                             fliglio/health - 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. fliglio/health

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fliglio/health
==============

Fliglio Health

3.0.1(4y ago)030.1k↓100%GPL-3.0+PHPPHP ^7.4||^8CI failing

Since May 3Pushed 4y ago7 watchersCompare

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

READMEChangelog (10)Dependencies (5)Versions (26)Used By (0)

[![Build Status](https://camo.githubusercontent.com/e2a22a36416d5c75bb9bc4d2c0b1874f3dab8fc41848a16fd1e0e434d1a1556c/68747470733a2f2f7472617669732d63692e6f72672f666c69676c696f2f6865616c74682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/fliglio/health)[![Latest Stable Version](https://camo.githubusercontent.com/d24ef24d2e0dce67e2ca9701166828a1c5870c972a222856aa6642b6e844395f/68747470733a2f2f706f7365722e707567782e6f72672f666c69676c696f2f6865616c74682f762f737461626c652e737667)](https://packagist.org/packages/fliglio/health)

fliglio-healthcheck
===================

[](#fliglio-healthcheck)

Extensible suite of health checks for PHP services, complete with custom behaviors to suit your health check consumer's needs. Default health checks include Mysql, Rabbit, Memcache, Can Write File, SSH and HttpResolver.

### Install With Composer

[](#install-with-composer)

```
{
	"require" : {
		"fliglio/health" : "2.1.*"
	}
}

```

Example One, Basic MySql Check:
===============================

[](#example-one-basic-mysql-check)

```
$manager = new HealthManager();
$manager->addCheck(new MysqlCheck('localhost', 'myuser', 'password'));

echo json_encode($manager->process());
```

If your connection information is good, you should see:

```
{"status":"UP", "mysql::localhost;myuser":"UP"}
```

If the connection is not good, for whatever reason, you'll get:

```
{"status":"DOWN", "mysql::localhost;myuser":"DOWN"}
```

Example Two, Optional Checks:
=============================

[](#example-two-optional-checks)

```
$manager = new HealthManager();
$manager->addCheck(new MysqlCheck('localhost', 'myuser', 'password'))
	->addOptionalCheck(new RabbitCheck('localhost', '/', 'myuser', 'password'));

echo json_encode($manager->process());
```

If the optional check is down, the status will remain "UP". Example:

```
{"status":"UP", "mysql::localhost;myuser":"UP", "rabbit::localhost;myuser":"WARN"}
```

Behavior Example:
=================

[](#behavior-example)

Depending on your apps health check reporting needs, you can add behaviors.

```
$response = new fliglio\Response();

$manager = new HealthManager();
$manager->addBehavior(new LogFailuresBehavior())
	->addBehavior(new LogWarningsBehavior())
	->addBehavior(new SilentOutputBehavior())
	->addBehavior(new StatusCodeBehavior($response);

$manager->addCheck(new MysqlCheck('localhost', 'myuser', 'password'));

echo json_encode($manager->process());
```

If the check is up, you will get HTTP 200 and a single json property. Example:

```
{"status":"UP"}
```

If the check is down, you will get HTTP 500, a message in the php log and a single json property. Example:

```
{"status":"DOWN"}
```

Silent Output + Logging Caveat:
===============================

[](#silent-output--logging-caveat)

If you want to log issue + have silent output, you have to put the SilentOutputBehavior after the loggers - otherwise the loggers wont know if there were any issues.

```
$manager = new HealthManager();
$manager->addBehavior(new LogIssuesBehavior())
	->addBehavior(new SilentOutputBehavior());
```

Public AWS ALB Behavior Example:
================================

[](#public-aws-alb-behavior-example)

```
$response = new fliglio\Response();

$manager = new HealthManager();
$manager->addBehavior(new SilentOutputBehavior())
	->addBehavior(new StatusCodeBehavior($response);
```

Custom Health Checks:
=====================

[](#custom-health-checks)

You can add your own custom health checks, just implement the interface Fliglio\\Health\\Api\\HealthCheck. If you want that health check to log, you'll need to implement the HealthCheckReport interface in addition to adding the LogFailuresBehavior/LogWarningsBehavior behavior.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 76.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 ~122 days

Recently: every ~208 days

Total

18

Last Release

1580d ago

Major Versions

2.3.x-dev → 3.0.12022-01-14

PHP version history (3 changes)2.1.9PHP &gt;=5.4.0

2.3.0PHP &gt;=5.6

3.0.1PHP ^7.4||^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b66bcc04aae61ef3cbc3770b8eb7b8bd5dfb6706e5f71b833c194e429b975fb?d=identicon)[benschw](/maintainers/benschw)

---

Top Contributors

[![philipwhitt](https://avatars.githubusercontent.com/u/5478888?v=4)](https://github.com/philipwhitt "philipwhitt (30 commits)")[![benschw](https://avatars.githubusercontent.com/u/98852?v=4)](https://github.com/benschw "benschw (2 commits)")[![Mehokm](https://avatars.githubusercontent.com/u/1044781?v=4)](https://github.com/Mehokm "Mehokm (2 commits)")[![oh4real](https://avatars.githubusercontent.com/u/152303?v=4)](https://github.com/oh4real "oh4real (2 commits)")[![sven7777](https://avatars.githubusercontent.com/u/5385519?v=4)](https://github.com/sven7777 "sven7777 (2 commits)")[![KokeClassic](https://avatars.githubusercontent.com/u/13053819?v=4)](https://github.com/KokeClassic "KokeClassic (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[ecotone/ecotone

Supporting you in building DDD, CQRS, Event Sourcing applications with ease.

558549.8k17](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[j0k3r/php-readability

Automatic article extraction from HTML

186808.8k6](/packages/j0k3r-php-readability)[symfony/ai-platform

PHP library for interacting with AI platform provider.

51927.7k136](/packages/symfony-ai-platform)[symfony/ai-agent

PHP library for building agentic applications.

30536.7k44](/packages/symfony-ai-agent)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)

PHPackages © 2026

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