PHPackages                             philiprehberger/php-install-doctor - 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. [CLI &amp; Console](/categories/cli)
4. /
5. philiprehberger/php-install-doctor

ActiveLibrary[CLI &amp; Console](/categories/cli)

philiprehberger/php-install-doctor
==================================

CLI diagnostic tool that checks PHP extensions, permissions, and configuration

v1.0.3(1mo ago)11[1 PRs](https://github.com/philiprehberger/php-install-doctor/pulls)MITPHPPHP ^8.2CI passing

Since Mar 13Pushed 1mo agoCompare

[ Source](https://github.com/philiprehberger/php-install-doctor)[ Packagist](https://packagist.org/packages/philiprehberger/php-install-doctor)[ Docs](https://github.com/philiprehberger/php-install-doctor)[ RSS](/packages/philiprehberger-php-install-doctor/feed)WikiDiscussions main Synced 1mo ago

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

PHP Install Doctor
==================

[](#php-install-doctor)

[![Tests](https://github.com/philiprehberger/php-install-doctor/actions/workflows/tests.yml/badge.svg)](https://github.com/philiprehberger/php-install-doctor/actions/workflows/tests.yml)[![Latest Version on Packagist](https://camo.githubusercontent.com/12b9d6cce7d4515a273f84e86bb1c0fbe9ea7e94c9a20e76da095dc8dee0af05/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068696c69707265686265726765722f7068702d696e7374616c6c2d646f63746f722e737667)](https://packagist.org/packages/philiprehberger/php-install-doctor)[![License](https://camo.githubusercontent.com/0c91a8babe0fbc811c7be8f1a8d3836205c59726ce6a3917d575ea4232f720af/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7068696c69707265686265726765722f7068702d696e7374616c6c2d646f63746f72)](LICENSE)

CLI diagnostic tool that checks PHP extensions, permissions, and configuration.

Requirements
------------

[](#requirements)

- PHP 8.2+

Installation
------------

[](#installation)

```
composer require philiprehberger/php-install-doctor
```

Usage
-----

[](#usage)

Run the built-in diagnostic command:

```
vendor/bin/doctor
```

Example output:

```
PHP Install Doctor
========================================
[PASS] PHP Version: PHP 8.3.4 meets minimum 8.2.0
[PASS] Extensions: All required extensions are loaded (json, mbstring, openssl, pdo, tokenizer, xml, ctype, fileinfo)
[PASS] Memory Limit: 256MB meets minimum 128MB

Results: 3 passed, 0 warnings, 0 failed (total: 3)

```

The command exits with code `0` if all checks pass, or `1` if any check fails.

### Programmatic Usage

[](#programmatic-usage)

### Run all default checks

[](#run-all-default-checks)

```
use PhilipRehberger\InstallDoctor\Doctor;

$report = Doctor::diagnose();

if ($report->isHealthy()) {
    echo "All checks passed!\n";
} else {
    echo $report->toConsoleOutput();
}
```

### Run specific checks

[](#run-specific-checks)

```
use PhilipRehberger\InstallDoctor\Doctor;
use PhilipRehberger\InstallDoctor\Checks\PhpVersionCheck;
use PhilipRehberger\InstallDoctor\Checks\ExtensionCheck;
use PhilipRehberger\InstallDoctor\Checks\MemoryLimitCheck;
use PhilipRehberger\InstallDoctor\Checks\DirectoryWritableCheck;

$report = Doctor::check(
    new PhpVersionCheck('8.2.0'),
    new ExtensionCheck(['pdo', 'redis', 'imagick']),
    new MemoryLimitCheck(256),
    new DirectoryWritableCheck(['/tmp', '/var/log']),
);

echo $report->toConsoleOutput();
```

### Get results as array

[](#get-results-as-array)

```
$report = Doctor::diagnose();
$data = $report->toArray();

// [
//     ['status' => 'pass', 'name' => 'PHP Version', 'message' => '...'],
//     ['status' => 'pass', 'name' => 'Extensions', 'message' => '...'],
//     ...
// ]
```

### Built-in Checks

[](#built-in-checks)

CheckDescriptionDefault`PhpVersionCheck`Verifies PHP meets a minimum version`8.2.0``ExtensionCheck`Checks that required extensions are loadedjson, mbstring, openssl, pdo, tokenizer, xml, ctype, fileinfo`MemoryLimitCheck`Validates memory limit meets a minimum`128` MB`DirectoryWritableCheck`Confirms directories exist and are writable(none)### Custom Checks

[](#custom-checks)

Implement the `Check` interface to create your own checks:

```
use PhilipRehberger\InstallDoctor\Contracts\Check;
use PhilipRehberger\InstallDoctor\CheckResult;

final class DatabaseConnectionCheck implements Check
{
    public function run(): CheckResult
    {
        try {
            new \PDO('mysql:host=localhost;dbname=app', 'root', '');
            return CheckResult::pass('Database', 'Connection successful');
        } catch (\PDOException $e) {
            return CheckResult::fail('Database', $e->getMessage());
        }
    }
}

$report = Doctor::check(
    new DatabaseConnectionCheck(),
);
```

API
---

[](#api)

### `Doctor`

[](#doctor)

MethodDescription`Doctor::diagnose(): DiagnosticReport`Run all default checks`Doctor::check(Check ...$checks): DiagnosticReport`Run specific checks### `DiagnosticReport`

[](#diagnosticreport)

Property / MethodDescription`$report->passed`Array of passed `CheckResult` instances`$report->warnings`Array of warning `CheckResult` instances`$report->failed`Array of failed `CheckResult` instances`$report->isHealthy(): bool``true` if no failures`$report->toArray(): array`All results as arrays`$report->toConsoleOutput(): string`Formatted console output### `CheckResult`

[](#checkresult)

MethodDescription`CheckResult::pass(string $name, string $message): self`Create a passing result`CheckResult::warning(string $name, string $message): self`Create a warning result`CheckResult::fail(string $name, string $message): self`Create a failing result`$result->toArray(): array`Result as associative array### `Status`

[](#status)

Enum with cases: `Pass`, `Warning`, `Fail`.

Development
-----------

[](#development)

```
composer install
vendor/bin/phpunit
vendor/bin/pint --test
vendor/bin/phpstan analyse
```

License
-------

[](#license)

MIT

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance90

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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 ~2 days

Total

4

Last Release

52d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cfd7d24cbbf32400fa13ce0bbe7a31edd2d66a6d4488eafdb3d64c5337bf0435?d=identicon)[philiprehberger](/maintainers/philiprehberger)

---

Top Contributors

[![philiprehberger](https://avatars.githubusercontent.com/u/8218077?v=4)](https://github.com/philiprehberger "philiprehberger (7 commits)")

---

Tags

phpcheckextensionsdoctordiagnostic

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/philiprehberger-php-install-doctor/health.svg)

```
[![Health](https://phpackages.com/badges/philiprehberger-php-install-doctor/health.svg)](https://phpackages.com/packages/philiprehberger-php-install-doctor)
```

###  Alternatives

[nunomaduro/termwind

It's like Tailwind CSS, but for the console.

2.5k239.8M286](/packages/nunomaduro-termwind)[nunomaduro/laravel-console-task

Laravel Console Task is a output method for your Laravel/Laravel Zero commands.

2582.1M11](/packages/nunomaduro-laravel-console-task)[alecrabbit/php-cli-snake

Lightweight cli spinner with zero dependencies

29211.3k5](/packages/alecrabbit-php-cli-snake)[graste/environaut

Define, configure and protect your application environment and its requirements.

142.7k](/packages/graste-environaut)

PHPackages © 2026

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