Creating a phpinfo page

When debugging complex PHPPHP PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. errors, it’s often beneficial to create a phpinfo() page. This page will output information about the current state of the server’s PHP installation, including information about PHP compilation options, extensions, version, server information and environment (if compiled as a module), the PHP environment, OS version information, paths, master and local values of configuration options, HTTPHTTP HTTP is an acronym for Hyper Text Transfer Protocol. HTTP is the underlying protocol used by the World Wide Web and this protocol defines how messages are formatted and transmitted, and what actions Web servers and browsers should take in response to various commands. headers, and the PHP License.

Because every system is setup differently, phpinfo() is commonly used to check configuration settings and for available predefined variables on a given system.

phpinfo() is also a valuable debugging tool as it contains all EGPCS (Environment, GET, POST, Cookie, Server) data.

Due to the volume of information that can be revealed in this file, it is strong suggested you delete it once you no longer need it.

To create the file simply add the following line of code to a blank document and name the file phpinfo.php :

<?php phpinfo(); ?>

Save the file as phpinfo.php and place it in the desired directory. Lastly, call the script from a browser.

Last updated: