phpinfo()
phpinfo() — Outputs information about PHP's configuration.
Built-in function of PHP 8.5. The manual lists it as available in PHP 4, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.
What it does
Outputs a large amount of information about the current state of PHP. This includes information about PHP compilation options and extensions, the PHP version, server information and environment (if compiled as a module), the PHP environment, OS version information, paths, master and local values of configuration options, HTTP headers, and the PHP License.
Signature
phpinfo(int $flags = INFO_ALL): true
Parameters
| Parameter | Type | What it takes |
|---|---|---|
| $flags | int | The output may be customized by passing one or more of the following constants bitwise values summed together in the optional flags parameter. One can also combine the respective constants or bitwise values together with the bitwise or operator. |
Return value
Always returns true.
Example
A runnable snippet:
// Show all information, defaults to INFO_ALL phpinfo(); // Show just the module information. // phpinfo(8) yields identical results. phpinfo(INFO_MODULES);
See also
phpversion(), phpcredits(), ini_get(), ini_set(), get_loaded_extensions()
All PHP 8.5 built-in functions
Reference card built from the PHP manual page phpinfo() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.