PHPackages                             stechstudio/phpinfo - 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. stechstudio/phpinfo

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

stechstudio/phpinfo
===================

A beautiful, searchable replacement for phpinfo() with a clean programmatic API

1.1(2mo ago)8731.8k↓43.5%41MITPHPPHP ^8.3CI passing

Since Mar 19Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/stechstudio/phpinfo)[ Packagist](https://packagist.org/packages/stechstudio/phpinfo)[ Docs](https://prettyphpinfo.com)[ RSS](/packages/stechstudio-phpinfo/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (2)Dependencies (5)Versions (9)Used By (1)

Pretty PHP Info
===============

[](#pretty-php-info)

[![Latest Version on Packagist](https://camo.githubusercontent.com/73287291a92dce17fdd05522fa4f11e8f68e404a6fe2b24b52e9b87bd8c9d163/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f737465636873747564696f2f706870696e666f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stechstudio/phpinfo)[![Total Downloads](https://camo.githubusercontent.com/8cea0ee6f7dbf774f4cb1b829653b254af816afc0ee18ef7337c12840665fe74/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f737465636873747564696f2f706870696e666f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stechstudio/phpinfo)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Tests](https://camo.githubusercontent.com/73623dc4c37fd15ec04c12792b4acb1371bb815927ac3adffbc45806bc95d4a7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f737465636873747564696f2f706870696e666f2f74657374732e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265266c6162656c3d7465737473)](https://github.com/stechstudio/phpinfo/actions/workflows/tests.yml)

A beautiful, searchable replacement for `phpinfo()`. Query PHP configuration programmatically or browse it in a modern UI with dark mode, instant search, and click-to-copy.

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

[](#requirements)

- PHP 8.3+
- `ext-dom`

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

[](#installation)

```
composer require stechstudio/phpinfo
```

Quickstart
----------

[](#quickstart)

The simplest way to use this package is the global `prettyphpinfo()` function — a drop-in replacement for `phpinfo()`:

```
prettyphpinfo();
```

That's it. You'll get a pretty, searchable, dark-mode-ready page instead of the default `phpinfo()` output.

> If you're not using a framework with Composer autoloading, you'll need to add `require __DIR__ . '/vendor/autoload.php';` first.

[![phpinfo-screenshot](https://private-user-images.githubusercontent.com/203749/566902750-7737f2f9-da88-4465-8b25-130af7e3908d.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODI5MzIxNDEsIm5iZiI6MTc4MjkzMTg0MSwicGF0aCI6Ii8yMDM3NDkvNTY2OTAyNzUwLTc3MzdmMmY5LWRhODgtNDQ2NS04YjI1LTEzMGFmN2UzOTA4ZC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNzAxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDcwMVQxODUwNDFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1jNjIxZjg0YzFiODNkOWYwY2MwNjgzY2I2NWRhNjlmNzRiMTFiZWMyNDhlNzA0Y2FiMDVlNWZiMmU4NDY4MmQxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZyZXNwb25zZS1jb250ZW50LXR5cGU9aW1hZ2UlMkZwbmcifQ.3UJmFouevwFrOKiF-tNRfoFki_YX4FO80ZeG_WkOtto)](https://private-user-images.githubusercontent.com/203749/566902750-7737f2f9-da88-4465-8b25-130af7e3908d.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODI5MzIxNDEsIm5iZiI6MTc4MjkzMTg0MSwicGF0aCI6Ii8yMDM3NDkvNTY2OTAyNzUwLTc3MzdmMmY5LWRhODgtNDQ2NS04YjI1LTEzMGFmN2UzOTA4ZC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNzAxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDcwMVQxODUwNDFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1jNjIxZjg0YzFiODNkOWYwY2MwNjgzY2I2NWRhNjlmNzRiMTFiZWMyNDhlNzA0Y2FiMDVlNWZiMmU4NDY4MmQxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZyZXNwb25zZS1jb250ZW50LXR5cGU9aW1hZ2UlMkZwbmcifQ.3UJmFouevwFrOKiF-tNRfoFki_YX4FO80ZeG_WkOtto)Just like the native `phpinfo()`, you can pass `INFO_*` constants to control which sections are displayed:

```
// Only show modules (excludes environment variables — useful for security)
prettyphpinfo(INFO_MODULES);

// Only general information
prettyphpinfo(INFO_GENERAL);

// Combine flags
prettyphpinfo(INFO_GENERAL | INFO_MODULES);
```

You can also use the class-based API directly:

```
STS\Phpinfo\Info::render();
```

### Interact with `phpinfo()` configuration

[](#interact-with-phpinfo-configuration)

If you're looking to directly inspect and interact with the configuration, capture it first:

```
use STS\Phpinfo\Info;

$info = Info::capture();

// Or capture a subset
$info = Info::capture(INFO_MODULES);
```

If you have `phpinfo()` output that you've saved previously and want to load and parse:

```
use STS\Phpinfo\Info;

// If you've saved the HTML output from phpinfo()
$info = Info::fromHtml($yourSavedHtmlOutput);

// If you've saved the CLI output from phpinfo()
$info = Info::fromText($yourSavedTextOutput);

// Or if you don't know the format, let the package detect it
$info = Info::detect($yourSavedOutput);
```

From here you can query base info, modules, and configs:

```
// Your PHP version
$info->version(); // "8.5.4"

// Check for the presence of a specific module. Name is case-insensitive.
$info->hasModule('redis'); // true

// Check to see if a specific configuration key is present.
$info->hasConfig('ICU version'); // true

// Retrieve the value for a specific configuration key. If there is both
// a local and master value, the local is returned by default.
$info->config('max_file_uploads'); // "20"

// Pass 'master' to get the php.ini default instead of the effective local value.
$info->config('max_file_uploads', 'master'); // "100"
$info->config('BCMath support', 'master'); // null

// Convenience methods for common lookups
$info->os(); // "Linux"
$info->hostname(); // "my-server"
```

Iterating over data structure
-----------------------------

[](#iterating-over-data-structure)

You can iterate over the full data structure to loop over your `phpinfo()` configuration. All lists (`modules()`, `groups()`, `configs()`) return iterable `Items` objects with `filter()`, `map()`, `first()`, `each()`, `count()`, and more.

```
// Loop over defined modules
foreach($info->modules() as $module) {
    $module->name(); // "session"

    // Configs are grouped the same way phpinfo() groups them by table
    foreach($module->groups() as $group) {
        $group->headings(); // ["Directive", "Local Value", "Master Value"]

        foreach($group->configs() as $config) {
            $config->name(); // "session.gc_maxlifetime"
            $config->localValue(); // "1440"

            $config->hasMasterValue(); // true
            $config->masterValue(); // "28800"
        }
    }
}
```

The data structure has four levels:

1. `PhpInfo` containing `modules()`
2. Modules with `name()`, containing `groups()`
3. Groups containing `configs()` and optionally `headings()`
4. Configs with `name()`, `value()`/`localValue()`, and optionally `masterValue()`

You can also access configs directly from the Module and PhpInfo levels:

```
// Flatten grouped configs for a single module
$info->module('session')->configs();

// Flatten ALL configs across all modules
$info->configs();
```

### Modules and Groups

[](#modules-and-groups)

Look up a specific module and inspect it directly:

```
// Case-insensitive lookup. Returns null if not found.
$module = $info->module('zend opcache');

// Retrieve the name as displayed in phpinfo()
$module->name(); // "Zend OPcache"

// Flatten all configs into one collection
$module->configs()->count(); // 59

// Query a specific config from this module
$module->config('Max keys'); // "16229"
$module->config('opcache.enable_file_override', 'master'); // "Off"

// Access individual groups
$group = $info->module('session')->groups()->first();
```

### Simple example

[](#simple-example)

```
foreach ($info->modules() as $module) {
    echo '' . $module->name() . '';

    echo '';
    foreach($module->configs() as $config) {
        echo '';
        echo $config->name() . ': ' . $config->value();
        if($config->hasMasterValue()) {
            echo ' (master: ' . $config->masterValue() . ')';
        }
        echo '';
    }
    echo '';
}
```

Why not just use `ini_get()` or `extension_loaded()`?
-----------------------------------------------------

[](#why-not-just-use-ini_get-or-extension_loaded)

PHP configuration is spread across a bunch of different functions, each with a narrow scope:

- `ini_get()` returns a single INI value, and only the local (effective) value
- `extension_loaded()` tells you if an extension is loaded, but nothing about its configuration
- `get_loaded_extensions()` gives you a list of names with no details
- `phpversion()` and `php_uname()` each return one thing

All of these require you to know exactly what you're looking for ahead of time. There's no way to discover what's available, iterate over all configuration, or search across modules.

Even if you combine all of them, there are things they simply can't tell you. The configure command PHP was compiled with, Zend extension details, stream wrappers, registered filters, and various per-extension metadata are only available through `phpinfo()`.

`phpinfo()` is the only function that gives you everything in one place. The problem is it dumps raw HTML (or plain text in CLI) with no API to work with.

This package parses that complete `phpinfo()` output and gives you:

- Iterate over all modules and configs without knowing what's installed
- Get both local and master values (`ini_get()` only returns the effective local value)
- Access phpinfo()-only data like compile options, stream wrappers, and registered filters
- One consistent API instead of juggling five different functions with different return types

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance82

Actively maintained with recent releases

Popularity43

Moderate usage in the ecosystem

Community15

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.2% 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 ~162 days

Recently: every ~94 days

Total

8

Last Release

89d ago

Major Versions

0.6 → 1.02026-03-20

PHP version history (2 changes)0.1PHP ^8.0

0.5PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/315be5f111b5501a41b99a0205c9c85915335391168a0ed10316546a1a38bbd8?d=identicon)[jszobody](/maintainers/jszobody)

---

Top Contributors

[![jszobody](https://avatars.githubusercontent.com/u/203749?v=4)](https://github.com/jszobody "jszobody (54 commits)")[![xiaoguo0426](https://avatars.githubusercontent.com/u/8944962?v=4)](https://github.com/xiaoguo0426 "xiaoguo0426 (1 commits)")

---

Tags

infophpphpinfoconfigurationphpinfophp infoserver-infopretty-phpinfo

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[illuminate/support

The Illuminate Support package.

630113.0M41.5k](/packages/illuminate-support)[illuminate/events

The Illuminate Events package.

13557.0M2.1k](/packages/illuminate-events)[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[illuminate/config

The Illuminate Config package.

10944.5M2.5k](/packages/illuminate-config)[illuminate/pagination

The Illuminate Pagination package.

12234.1M1.0k](/packages/illuminate-pagination)[illuminate/session

The Illuminate Session package.

9939.3M850](/packages/illuminate-session)

PHPackages © 2026

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