phpinfo()

The phpinfo() is commonly used to check the configuration settings of the system. It is also used as a debugging tool.

The phpinfo() provides detailed information about te PHP compilation options and extensions, server infomation and environment, OS version information, PHP version, the PHP environment, paths, master and local values of configuration options, HTTP headers, and the PHP License.

// EXAMPLE

php // Show all information, defaults to INFO\_ALL phpinfo(); // Show just the module information. // phpinfo(8) yields identical results. phpinfo(INFO\_MODULES); ?

The output may be customized by passing one or more of the following constants bitwise values summed together in the optional what parameter. One can also combine the respective constants or bitwise values together with the or operator.

phpinfo() options:
Name (constant) - Value - Description
INFO\_GENERAL - 1 - The configuration line, php.ini location, build date, Web Server, System and more.
INFO\_CREDITS - 2 - PHP Credits.
INFO\_CONFIGURATION - 4 - Current Local and Master values for PHP directives.
INFO\_MODULES - 8 - Loaded modules and their respective settings.
INFO\_ENVIRONMENT - 16 - Environment Variable information.
INFO\_VARIABLES - 32 - Shows all predefined variables from EGPCS (Environment, GET, POST, Cookie, Server).
INFO\_LICENSE - 64 - PHP License information.
INFO\_ALL - -1 - Shows all of the above.

NOTE: Your phpinfo.php file needs to be a plain text file. This means you need to make it in a text editing program capable of producing plain text files.

After you have created your phpinfo.php file - uload the file to the server. You should upload your file to the exact directory you want to test and visit the page in your browser.

Now you can view all of the information about your server's PHP configuration for the particular directory where your phpinfo.php file has been uploaded.