PHPackages                             self-heallm/php-self-heallm - 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. self-heallm/php-self-heallm

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

self-heallm/php-self-heallm
===========================

Framework-agnostic PHP library for automated error triage and LLM-powered self-healing.

v0.1.0(2mo ago)00MITPHP ^8.2

Since May 9Compare

[ Source](https://github.com/universe-coder/php-self-heallm)[ Packagist](https://packagist.org/packages/self-heallm/php-self-heallm)[ Docs](https://github.com/universe-coder/php-self-heallm)[ RSS](/packages/self-heallm-php-self-heallm/feed)WikiDiscussions Synced 3w ago

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

php-self-heallm
===============

[](#php-self-heallm)

**Packagist ([`self-heallm/php-self-heallm`](https://packagist.org/packages/self-heallm/php-self-heallm))**

[![Latest Version](https://camo.githubusercontent.com/81de6ccd0909549e3cabe0fb5678c891ace99a566a926ba562b8bc529aa9f647/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73656c662d6865616c6c6d2f7068702d73656c662d6865616c6c6d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/self-heallm/php-self-heallm)[![License](https://camo.githubusercontent.com/c14b7bbcaebf94e427c5667549d92633546e8575ac08757c4810468614f6448a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73656c662d6865616c6c6d2f7068702d73656c662d6865616c6c6d2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![PHP Version](https://camo.githubusercontent.com/eb46e320687c817c00de4ebc64c3ac4d14d69ea3f8ff6d47fbdc319ec8a0cea0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f73656c662d6865616c6c6d2f7068702d73656c662d6865616c6c6d2f7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/self-heallm/php-self-heallm)[![Symfony HttpClient](https://camo.githubusercontent.com/0a00952fb4a9a1b8702e3a433aef90be1fce5c1b35e426997a3fb58330f404dc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f73656c662d6865616c6c6d2f7068702d73656c662d6865616c6c6d2f73796d666f6e79253246687474702d636c69656e742e7376673f6c6162656c3d73796d666f6e79253246687474702d636c69656e74267374796c653d666c61742d737175617265)](https://packagist.org/packages/self-heallm/php-self-heallm)[![Total Downloads](https://camo.githubusercontent.com/8831290084ad1ab905fee455c3444c746e6117c8c1d6e98ae772d6cac8ede4e3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73656c662d6865616c6c6d2f7068702d73656c662d6865616c6c6d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/self-heallm/php-self-heallm)[![Monthly Downloads](https://camo.githubusercontent.com/65fa2cd5487b3a0a459f5c9e3a5a5bbcd2cfa6c0a46804769c6d95acacdc90e1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f73656c662d6865616c6c6d2f7068702d73656c662d6865616c6c6d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/self-heallm/php-self-heallm)

**GitHub ([`universe-coder/php-self-heallm`](https://github.com/universe-coder/php-self-heallm))**

[![GitHub Stars](https://camo.githubusercontent.com/3cf09a236048ceac757bb617c7d1145248a5deb6582488fff80060afe861006c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f756e6976657273652d636f6465722f7068702d73656c662d6865616c6c6d2e7376673f7374796c653d666c61742d737175617265)](https://github.com/universe-coder/php-self-heallm/stargazers)[![Open Issues](https://camo.githubusercontent.com/cbb43865461689918297a8db1094a8053ed1479e239c095a170f17e485ccab7e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f756e6976657273652d636f6465722f7068702d73656c662d6865616c6c6d2e7376673f7374796c653d666c61742d737175617265)](https://github.com/universe-coder/php-self-heallm/issues)[![Last Commit](https://camo.githubusercontent.com/a1d392895018e51fb913436c780e477876dbbd50872ffa3b9c00b0ce935d4326/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f756e6976657273652d636f6465722f7068702d73656c662d6865616c6c6d2e7376673f7374796c653d666c61742d737175617265)](https://github.com/universe-coder/php-self-heallm/commits/main)[![GitHub forks](https://camo.githubusercontent.com/9268ac0d5f62140fb42858a9ded5a7c8fe9d24eb52a005ea455e4f9f26d0617c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f756e6976657273652d636f6465722f7068702d73656c662d6865616c6c6d2e7376673f7374796c653d666c61742d737175617265)](https://github.com/universe-coder/php-self-heallm/network/members)

Canonical repository URLs are in [`composer.json`](composer.json) (`homepage`, `support`). The Composer package name on Packagist remains [`self-heallm/php-self-heallm`](https://packagist.org/packages/self-heallm/php-self-heallm).

Framework-agnostic PHP Composer library that scans recent log errors, asks an LLM for a fix (OpenAI, Anthropic, Hugging Face OpenAI-compatible endpoint, or Ollama), validates path safety, optionally applies patches, and sends reports (Telegram, Slack, webhook, Sentry, JSONL file).

Install
-------

[](#install)

```
composer require self-heallm/php-self-heallm
```

CLI
---

[](#cli)

From your project root (with `config/self-heal.php` or env vars):

```
vendor/bin/self-heal
```

Or pass an explicit config path:

```
vendor/bin/self-heal --config=/absolute/path/to/self-heal.php
```

Copy [config/self-heal.php](config/self-heal.php) into your app and adjust paths under `log`, `reporting`, and `deduplication` defaults (package defaults use `/var/...` when shipped alone).

Programmatic use
----------------

[](#programmatic-use)

```
use SelfHealLM\Bootstrap\SelfHealApplication;

$pipeline = SelfHealApplication::fromConfigFile(__DIR__ . '/config/self-heal.php');
$result = $pipeline->run(); // ['status' => 'ok'|'skipped', 'reason' => ...?]
```

Or build config in memory:

```
$pipeline = SelfHealApplication::fromConfigArray([
    'enabled' => true,
    'dry_run' => true,
    'log' => ['path' => '/var/log/app.log', 'max_lines' => 200],
    // ... same keys as in config/self-heal.php (no outer `self-heal` key required)
]);
```

Environment variables
---------------------

[](#environment-variables)

Same `SELF_HEAL_*` names as the Laravel-oriented package; see [config/self-heal.php](config/self-heal.php) for the full list. Set `SELF_HEAL_OPENAI_TOKEN`, `SELF_HEAL_LOG_PATH`, etc., in your process environment or `.env` loader before including the config file.

Security
--------

[](#security)

- Only paths under configured `allowed_paths` are accepted; `forbidden_paths` always win.
- Auto-apply runs only when `enabled`, `auto_apply`, and `dry_run` are set accordingly in config.

Related
-------

[](#related)

The [laravel-self-heallm](https://github.com/universe-coder/laravel-self-heallm) package targets Laravel apps; this library is suitable for any PHP runtime with Composer.

License
-------

[](#license)

MIT. See [LICENSE](LICENSE).

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance85

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

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

Unknown

Total

1

Last Release

76d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/22217470?v=4)[Pavel Sergeev](/maintainers/universe-coder)[@universe-coder](https://github.com/universe-coder)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/self-heallm-php-self-heallm/health.svg)

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

PHPackages © 2026

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