{"id":23003730,"url":"https://github.com/stechstudio/phpinfo","last_synced_at":"2026-04-06T20:04:18.355Z","repository":{"id":345756214,"uuid":"1186358171","full_name":"stechstudio/phpinfo","owner":"stechstudio","description":"Parse, query, and display your PHP configuration with a clean API and a modern, searchable interface. Drop-in replacement for the default phpinfo() page.","archived":false,"fork":false,"pushed_at":"2026-03-28T15:35:25.000Z","size":154,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-28T17:50:42.901Z","etag":null,"topics":["info","php","phpinfo"],"latest_commit_sha":null,"homepage":"https://prettyphpinfo.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stechstudio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-19T14:41:38.000Z","updated_at":"2026-03-28T15:35:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/stechstudio/phpinfo","commit_stats":null,"previous_names":["stechstudio/phpinfo"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/stechstudio/phpinfo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stechstudio%2Fphpinfo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stechstudio%2Fphpinfo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stechstudio%2Fphpinfo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stechstudio%2Fphpinfo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stechstudio","download_url":"https://codeload.github.com/stechstudio/phpinfo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stechstudio%2Fphpinfo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31487543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T17:22:55.647Z","status":"ssl_error","status_checked_at":"2026-04-06T17:22:54.741Z","response_time":112,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["info","php","phpinfo"],"created_at":"2024-12-15T07:15:11.811Z","updated_at":"2026-04-06T20:04:18.349Z","avatar_url":"https://github.com/stechstudio.png","language":"PHP","readme":"# Pretty PHP Info\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/stechstudio/phpinfo.svg?style=flat-square)](https://packagist.org/packages/stechstudio/phpinfo)\n[![Total Downloads](https://img.shields.io/packagist/dt/stechstudio/phpinfo.svg?style=flat-square)](https://packagist.org/packages/stechstudio/phpinfo)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)\n[![Tests](https://img.shields.io/github/actions/workflow/status/stechstudio/phpinfo/tests.yml?branch=main\u0026style=flat-square\u0026label=tests)](https://github.com/stechstudio/phpinfo/actions/workflows/tests.yml)\n\nA 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.\n\n## Requirements\n\n- PHP 8.3+\n- `ext-dom`\n\n## Installation\n\n```bash\ncomposer require stechstudio/phpinfo\n```\n\n## Quickstart\n\nThe simplest way to use this package is the global `prettyphpinfo()` function — a drop-in replacement for `phpinfo()`:\n\n```php\nprettyphpinfo();\n```\n\nThat's it. You'll get a pretty, searchable, dark-mode-ready page instead of the default `phpinfo()` output.\n\n\u003e If you're not using a framework with Composer autoloading, you'll need to add `require __DIR__ . '/vendor/autoload.php';` first.\n\n\u003cimg width=\"1506\" height=\"990\" alt=\"phpinfo-screenshot\" src=\"https://github.com/user-attachments/assets/7737f2f9-da88-4465-8b25-130af7e3908d\" /\u003e\n\n\nJust like the native `phpinfo()`, you can pass `INFO_*` constants to control which sections are displayed:\n\n```php\n// Only show modules (excludes environment variables — useful for security)\nprettyphpinfo(INFO_MODULES);\n\n// Only general information\nprettyphpinfo(INFO_GENERAL);\n\n// Combine flags\nprettyphpinfo(INFO_GENERAL | INFO_MODULES);\n```\n\nYou can also use the class-based API directly:\n\n```php\nSTS\\Phpinfo\\Info::render();\n```\n\n### Interact with `phpinfo()` configuration\n\nIf you're looking to directly inspect and interact with the configuration, capture it first:\n\n```php\nuse STS\\Phpinfo\\Info;\n\n$info = Info::capture();\n\n// Or capture a subset\n$info = Info::capture(INFO_MODULES);\n```\n\nIf you have `phpinfo()` output that you've saved previously and want to load and parse:\n```php\nuse STS\\Phpinfo\\Info;\n\n// If you've saved the HTML output from phpinfo()\n$info = Info::fromHtml($yourSavedHtmlOutput);\n\n// If you've saved the CLI output from phpinfo()\n$info = Info::fromText($yourSavedTextOutput);\n\n// Or if you don't know the format, let the package detect it\n$info = Info::detect($yourSavedOutput);\n```\n\nFrom here you can query base info, modules, and configs:\n```php\n// Your PHP version\n$info-\u003eversion(); // \"8.5.4\"\n\n// Check for the presence of a specific module. Name is case-insensitive.\n$info-\u003ehasModule('redis'); // true\n\n// Check to see if a specific configuration key is present.\n$info-\u003ehasConfig('ICU version'); // true\n\n// Retrieve the value for a specific configuration key. If there is both\n// a local and master value, the local is returned by default.\n$info-\u003econfig('max_file_uploads'); // \"20\"\n\n// Pass 'master' to get the php.ini default instead of the effective local value.\n$info-\u003econfig('max_file_uploads', 'master'); // \"100\"\n$info-\u003econfig('BCMath support', 'master'); // null\n\n// Convenience methods for common lookups\n$info-\u003eos(); // \"Linux\"\n$info-\u003ehostname(); // \"my-server\"\n```\n\n## Iterating over data structure\n\nYou 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.\n\n```php\n// Loop over defined modules\nforeach($info-\u003emodules() as $module) {\n    $module-\u003ename(); // \"session\"\n    \n    // Configs are grouped the same way phpinfo() groups them by table\n    foreach($module-\u003egroups() as $group) {\n        $group-\u003eheadings(); // [\"Directive\", \"Local Value\", \"Master Value\"]\n        \n        foreach($group-\u003econfigs() as $config) {\n            $config-\u003ename(); // \"session.gc_maxlifetime\"\n            $config-\u003elocalValue(); // \"1440\"\n            \n            $config-\u003ehasMasterValue(); // true\n            $config-\u003emasterValue(); // \"28800\"\n        }\n    }\n}\n```\n\nThe data structure has four levels:\n\n1. `PhpInfo` containing `modules()`\n2. Modules with `name()`, containing `groups()`\n3. Groups containing `configs()` and optionally `headings()`\n4. Configs with `name()`, `value()`/`localValue()`, and optionally `masterValue()`\n\nYou can also access configs directly from the Module and PhpInfo levels:\n\n```php\n// Flatten grouped configs for a single module\n$info-\u003emodule('session')-\u003econfigs();\n\n// Flatten ALL configs across all modules\n$info-\u003econfigs();\n```\n\n### Modules and Groups\n\nLook up a specific module and inspect it directly:\n\n```php\n// Case-insensitive lookup. Returns null if not found.\n$module = $info-\u003emodule('zend opcache');\n\n// Retrieve the name as displayed in phpinfo()\n$module-\u003ename(); // \"Zend OPcache\"\n\n// Flatten all configs into one collection\n$module-\u003econfigs()-\u003ecount(); // 59\n\n// Query a specific config from this module\n$module-\u003econfig('Max keys'); // \"16229\"\n$module-\u003econfig('opcache.enable_file_override', 'master'); // \"Off\"\n\n// Access individual groups\n$group = $info-\u003emodule('session')-\u003egroups()-\u003efirst();\n```\n\n### Simple example\n\n```php\nforeach ($info-\u003emodules() as $module) {\n    echo '\u003ch2\u003e' . $module-\u003ename() . '\u003c/h2\u003e';\n\n    echo '\u003cul\u003e';\n    foreach($module-\u003econfigs() as $config) {\n        echo '\u003cli\u003e';\n        echo $config-\u003ename() . ': ' . $config-\u003evalue();\n        if($config-\u003ehasMasterValue()) {\n            echo ' (master: ' . $config-\u003emasterValue() . ')';\n        }\n        echo '\u003c/li\u003e';\n    }\n    echo '\u003c/ul\u003e';\n}\n```\n\n## Why not just use `ini_get()` or `extension_loaded()`?\n\nPHP configuration is spread across a bunch of different functions, each with a narrow scope:\n\n- `ini_get()` returns a single INI value, and only the local (effective) value\n- `extension_loaded()` tells you if an extension is loaded, but nothing about its configuration\n- `get_loaded_extensions()` gives you a list of names with no details\n- `phpversion()` and `php_uname()` each return one thing\n\nAll 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.\n\nEven 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()`.\n\n`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.\n\nThis package parses that complete `phpinfo()` output and gives you:\n\n- Iterate over all modules and configs without knowing what's installed\n- Get both local and master values (`ini_get()` only returns the effective local value)\n- Access phpinfo()-only data like compile options, stream wrappers, and registered filters\n- One consistent API instead of juggling five different functions with different return types\n","funding_links":[],"categories":["PHP"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstechstudio%2Fphpinfo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstechstudio%2Fphpinfo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstechstudio%2Fphpinfo/lists"}