PHP phpinfo() Function

PHP phpinfo() Function is used to check information about PHP's configuration, Predefined Variables, extensions, the PHP version, server information, environment, HTTP headers, and the PHP License etc on a given system.

Syntax :

phpinfo(int $options= INFO_ALL)


$options: Optional. You can input below constants with one or more of value.

phpinfo options
Constant Value Description
INFO_GENERAL 1 It shows configuration line, php.ini location, build date, Web Server, System and more
INFO_CREDITS 2 It shows PHP Credits. Get from also phpcredits().
INFO_CONFIGURATION 4 It shows current Local and Master values for PHP directives. Get from also ini_get().
INFO_MODULES 8 It shows loaded modules and their respective settings. Get from also get_loaded_extensions().
INFO_ENVIRONMENT 16 It shows environment Variable information. Get from also $_ENV.
INFO_VARIABLES 32 It shows all predefined variables from EGPCS (Environment, GET, POST, Cookie, Server).
INFO_LICENSE 64 It shows PHP License information.
INFO_ALL -1 It shows all of the above details.

Return Values :

It returns true on success or false on failure.

Let's see below example to understand php phpinfo() Function in details.

Example :


Output :


Leave a Reply

Your email address will not be published. Required fields are marked *