phpinfo() creates a web page with comprehensive system environment information such as operating system and web server environment, PHP configuration, paths, global and local values of configuration options, HTTP headers, etc. Because every system is setup differently, phpinfo() is often used to check configuration settings and predefined system variables. phpinfo() is also a valuable debugging tool as it lists GET, POST, cookie, environment and server data.
It doesn't come as a surprise that the following script is often the first PHP script a PHP developer runs on a new client system:
The above script is usually saved under a file name such as
phpinfo.php. Since phpinfo() exposes information which might help hackers to break into a system, it is not recommended to provide easy and/or permanent public access to phpinfo() scripts.
PHP Function phpinfo (INFO) • © 2023 Manfred Baumeister • Updated: 02 October 2010, 23:36 [UTC]