/ˌpiː.eɪtʃ.piːˈɪnfoʊ/

noun — “a full snapshot of your PHP environment in one noisy page.”

phpinfo is a built-in diagnostic function in PHP that outputs a comprehensive report about the current configuration of the PHP runtime environment. It reveals details about the server setup, loaded extensions, configuration directives, environment variables, HTTP headers, and more—all rendered as a structured HTML page. For developers, it’s often the first place to look when something feels off… or when nothing works and you’re not sure why.

At its core, phpinfo exists to answer a deceptively simple question: “what exactly is this server doing?” Because PHP applications depend heavily on runtime configuration—things like enabled modules, memory limits, file upload sizes, and database drivers—understanding the environment is critical. A missing extension or incorrect setting can silently break functionality, and phpinfo exposes those details in plain sight.

Historically, phpinfo has been part of PHP since its early versions, serving as a quick introspection tool during development. It became especially useful in shared hosting environments, where developers often lacked direct access to configuration files like php.ini. Instead of guessing, they could simply run phpinfo and inspect the actual runtime values. Over time, it evolved to include more granular information, such as compilation options, API versions, and extension-specific settings.

The output of phpinfo is dense… almost overwhelming at first glance. It’s organized into sections, including general system information, PHP core settings, loaded modules, and environment variables. Each configuration directive shows both its “local” and “master” values, which helps identify overrides at runtime. For example, you might discover that upload_max_filesize is set differently in your application context than in the global configuration.

In practice, phpinfo might include:

<?php
// Example 1: basic usage
phpinfo();
?>

// Example 2: limited output (configuration only)
<?php
phpinfo(INFO_CONFIGURATION);
?>

While incredibly useful, phpinfo comes with a sharp edge: security. The information it reveals—server paths, loaded modules, environment variables, and sometimes sensitive configuration—can be valuable to attackers. Leaving a publicly accessible phpinfo page on a production server is essentially handing out a blueprint of your system. Best practice is simple: use it during development or debugging, then remove or restrict access immediately afterward.

Conceptually, phpinfo is like popping the hood on your server while it’s running. You’re not just seeing the engine—you’re seeing how it’s tuned, what parts are installed, and how everything is wired together. It’s noisy, verbose, and occasionally overwhelming… but when you need it, nothing else gives you such a complete picture so quickly.

See PHP, Server Environment, Configuration File, Web Server