| Recommend this page to a friend! |
| Info | Example | Demos | Screenshots | Reputation | Support forum | Blog | Links |
| Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
| 2025-11-29 (13 hours ago) | Not yet rated by the users | Total: Not yet counted | Not yet ranked | |||||
| Version | License | PHP version | Categories | |||
| betterphpinfo 1.0 | MIT/X Consortium ... | 5 | PHP 5, System information, Debug, Tools |
| Description | Author | |
This package can get information about the current PHP request. |
Please check this example script to learn how to get the current request information using the class functions.
<?php |
Version: 1.0 Author: Thomas Traunter | PHPLABOR | www.phplabor.de License: MIT License Description: A modern, visually appealing alternative to phpinfo() with search
functionality and improved organization using Bootstrap 5.
BetterPhpInfo is a PHP class that provides three main ways to access PHP configuration information:
Basic usage (no authentication):
$betterPhpInfo = new BetterPhpInfo();
$betterPhpInfo->render();
With authentication:
$betterPhpInfo = new BetterPhpInfo();
$betterPhpInfo->render('your_username', 'your_password');
Parameters: - username (optional): Required username for access - password (optional): Required password for access
Security: If authentication fails, the login form is shown again without any error messages (for security reasons).
Search for specific settings:
$results = $betterPhpInfo->search('memory');
$results = $betterPhpInfo->search('mysql');
$results = $betterPhpInfo->search('upload');
Returns: Array with matching configuration values organized by category.
Example result structure:
Array(
[Category Name] => Array(
[config_key] => Array(
[local] => 'value',
[master] => 'master_value'
)
)
)
Get individual configuration values using the exact key names:
$memoryLimit = $betterPhpInfo->get('memory_limit');
$phpVersion = $betterPhpInfo->get('PHP Version');
$uploadMax = $betterPhpInfo->get('upload_max_filesize');
Note: Key names may vary by PHP version. Use search() first to find exact names.
Returns: The local (currently active) value of the configuration setting, or null if not found.
Get list of all available configuration keys:
$allKeys = $betterPhpInfo->getAvailableKeys();
Returns: Array of all configuration keys that can be used with get() method.
How to work with configuration values:
FIND THE CORRECT KEY NAME: Use search() to find the exact key name you need:
$results = $betterPhpInfo->search('memory');
This will show all keys containing 'memory' with their exact names.
GET THE VALUE: Use the exact key name from search results:
$value = $betterPhpInfo->get('memory_limit');
Key names vary by PHP version and configuration - always search first.
MASTER VS LOCAL VALUES: - MASTER: Original value from php.ini configuration file - LOCAL: Currently active value (may be changed at runtime)
When values differ: - The setting was modified using ini_set(), .htaccess, or scripts - get() always returns the LOCAL value (what's currently active) - search() shows both values when they differ
Example: - php.ini has: memory_limit = 128M (Master) - Script runs: ini_set('memory_limit', '256M'); (changes Local) - Result: Master = 128M, Local = 256M - get('memory_limit') returns '256M' (the active value)
Standalone Page Features: - Modern Bootstrap 5 responsive design - Live search with highlighting - Collapsible categories with icons - Statistics overview - Clean formatting of boolean values (enabled/disabled) - 50/50 column layout for better readability - Optional username/password authentication
Search Features: - Case-insensitive search - Searches both keys and values - Returns organized results by category - Preserves all configuration data structure
Get Features: - Direct access to any configuration value - Accepts exact key names as shown in search results - Fast lookup by key name - Returns null for non-existent keys - Returns local (currently active) values
For a simple standalone PHP info page, you can also add this directly at the bottom of the BetterPhpInfo.php class file:
// Uncomment these lines for direct standalone usage:
// $betterPhpInfo = new BetterPhpInfo();
// $betterPhpInfo->render();
Then simply access the BetterPhpInfo.php file in your browser.
Login System: - Optional authentication for render() method - Pass username and password as parameters - Secure form-based authentication - No error messages for failed attempts (security feature) - Session-based (form POST method)
Security Features: - No information disclosure on failed login - Clean login interface - Form-based authentication - No timing attack vulnerabilities
Key names in PHP configuration can vary between versions and setups. Examples of possible variations:
RECOMMENDED WORKFLOW: 1. Use search() to locate configuration: $results = $betterPhpInfo->search('opcache'); 2. Examine results to find exact key name 3. Use exact key with get(): $value = $betterPhpInfo->get('opcache.enable');
This approach works reliably regardless of PHP version or key name variations.
Development Environment: - Use standalone without authentication for local development - Quick overview of PHP configuration - Search for specific settings during debugging
Production Monitoring: - Use with authentication for production servers - Programmatic access via get() for monitoring scripts - Search functionality for troubleshooting
Integration: - Embed search results in existing applications - Extract specific values for application logic - Monitor critical PHP settings programmatically
Issue: Blank page when using render() Solution: Check PHP error logs, ensure DOMDocument is available
Issue: Authentication not working Solution: Verify username/password are set correctly, check POST data
Issue: get() returns null for existing setting Solution: Use search() first to find the exact key name, then use that exact name
Issue: Search returns no results Solution: Try broader search terms, search is case-insensitive
Standalone page supports: - Chrome 60+ - Firefox 60+ - Safari 12+ - Edge 79+
Features used: - CSS Grid and Flexbox - Bootstrap 5 components - Modern JavaScript (ES6+)
The class can be extended for custom functionality: - Override getIconForCategory() for custom icons - Modify CSS in render() for custom styling - Extend search() for custom filtering logic - Add custom authentication methods
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
For questions or improvements, visit: https://www.phplabor.de
| example_get.php |
example_search.php |
example_standalone_no_login.php |
example_standalone_with_login.php |
| Screenshots (3) | ||
| File | Role | Description |
|---|---|---|
| Class | Class file | |
| Example | Example using get() | |
| Example | Example using search() | |
| Example | Standalone without login | |
| Example | Standalone with login | |
| Doc. | Instructions |
| The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
| Version Control | Unique User Downloads | |||||||
| 0% |
|
| Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.