PHP provides us with a built-in function phpinfo() which gives us the details about the PHP version and PHP configuration of PHP installed in our system. To know about the Configurations and PHP version which is installed in your computer, a simple PHP script can be used. The script consists of a PHP function called “phpinfo()” which outputs information about PHP’s configuration. The phpinfo() function is also useful in the debugging process.
This function generally outputs a large amount of information, such as:
- Information about PHP compilation options and extensions.
- PHP version.
- Server information and environment (if compiled as a module).
- PHP environment.
- OS version information, paths, master and local values of configuration options.
- HTTP headers.
- PHP license.
bool phpinfo ([ int $what = INFO_ALL ] )
$what : It is an optional parameter which can be used to display specific information.
It can take the following values:
- INFO_GENERAL:It is used to display the configuration line, php.ini location, build date, Web Server, System and more.
- INFO_CREDITS:It is used to display PHP Credits.
- INFO_CONFIGURATION: It is used to display current, local and Master values for PHP directives.
- INFO_MODULES: It is used to display loaded modules and their respective settings.
- INFO_ENVIRONMENT:It is used to display the environment variable information.
- INFO_VARIABLES:It shows all predefined variables from EGPCS (Environment, GET, POST, Cookie, Server).
- INFO_LICENSE:It is used to display PHP License information.
- INFO_ALL:It shows all of the above information.
Return Type: The phpinfo() function return a boolean value. That is, it returns true on success and false on faliure.
Displaying Complete information: To display the complete information on the PHP version, configurations, environment details etc. the phpinfo() function should be executed in the following way:
Note: phpinfo() outputs plain text instead of HTML when using the CLI mode.
- PHP | php.ini File Configuration
- Laravel | Installation and Configuration
- Management Information System (MIS)
- Difference between Information and Knowledge
- How to display logged in user information in PHP ?
- Management Information System (MIS) Models
- Constraints in geographical information system (GIS)
- Geographical information system (GIS) and its Components
- Characteristics of data in geographical information system (GIS)
- Web Information Retrieval | Vector Space Model
- Information Technology Infrastructure Library (ITIL)
- Difference between Management Information System (MIS) and Decision Support System (DSS)
- How to remove CSS “top” and “left” attribute with jQuery ?
- How to check if the given date is weekend ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : Akanksha_Rai