<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Outputs information about PHP's configuration</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.phpcredits.html">phpcredits</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.phpversion.html">phpversion</a></div> <div class="up"><a href="ref.info.html">PHP Options/Info Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.phpinfo" class="refentry"> <div class="refnamediv"> <h1 class="refname">phpinfo</h1> <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">phpinfo</span> — <span class="dc-title">Outputs information about PHP's configuration</span></p> </div> <div class="refsect1 description" id="refsect1-function.phpinfo-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">bool</span> <span class="methodname"><strong>phpinfo</strong></span> ([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$what</code><span class="initializer"> = INFO_ALL</span></span> ] )</div> <p class="para rdfs-comment"> Outputs a large amount of information about the current state of PHP. This includes information about PHP compilation options and extensions, the PHP version, server information and environment (if compiled as a module), the PHP environment, OS version information, paths, master and local values of configuration options, HTTP headers, and the PHP License. </p> <p class="para"> Because every system is setup differently, <span class="function"><strong>phpinfo()</strong></span> is commonly used to check <a href="configuration.html" class="link">configuration settings</a> and for available <a href="language.variables.predefined.html" class="link">predefined variables</a> on a given system. </p> <p class="para"> <span class="function"><strong>phpinfo()</strong></span> is also a valuable debugging tool as it contains all EGPCS (Environment, GET, POST, Cookie, Server) data. </p> </div> <div class="refsect1 parameters" id="refsect1-function.phpinfo-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">what</code></em></span> <dd> <p class="para"> The output may be customized by passing one or more of the following <em class="emphasis">constants</em> bitwise values summed together in the optional <em><code class="parameter">what</code></em> parameter. One can also combine the respective constants or bitwise values together with the <a href="language.operators.bitwise.html" class="link">or</a> operator. </p> <p class="para"> <table class="doctable table"> <caption><strong> <span class="function"><strong>phpinfo()</strong></span> options</strong></caption> <thead> <tr> <th>Name (constant)</th> <th>Value</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr> <td>INFO_GENERAL</td> <td>1</td> <td> The configuration line, <var class="filename">php.ini</var> location, build date, Web Server, System and more. </td> </tr> <tr> <td>INFO_CREDITS</td> <td>2</td> <td> PHP Credits. See also <span class="function"><a href="function.phpcredits.html" class="function">phpcredits()</a></span>. </td> </tr> <tr> <td>INFO_CONFIGURATION</td> <td>4</td> <td> Current Local and Master values for PHP directives. See also <span class="function"><a href="function.ini-get.html" class="function">ini_get()</a></span>. </td> </tr> <tr> <td>INFO_MODULES</td> <td>8</td> <td> Loaded modules and their respective settings. See also <span class="function"><a href="function.get-loaded-extensions.html" class="function">get_loaded_extensions()</a></span>. </td> </tr> <tr> <td>INFO_ENVIRONMENT</td> <td>16</td> <td> Environment Variable information that's also available in <var class="varname"><var class="varname"><a href="reserved.variables.environment.html" class="classname">$_ENV</a></var></var>. </td> </tr> <tr> <td>INFO_VARIABLES</td> <td>32</td> <td> Shows all <a href="language.variables.predefined.html" class="link"> predefined variables</a> from EGPCS (Environment, GET, POST, Cookie, Server). </td> </tr> <tr> <td>INFO_LICENSE</td> <td>64</td> <td> PHP License information. See also the <a href="http://www.php.net/license/" class="link external">» license FAQ</a>. </td> </tr> <tr> <td>INFO_ALL</td> <td>-1</td> <td> Shows all of the above. </td> </tr> </tbody> </table> </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.phpinfo-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure. </p> </div> <div class="refsect1 changelog" id="refsect1-function.phpinfo-changelog"> <h3 class="title">Changelog</h3> <p class="para"> <table class="doctable informaltable"> <thead> <tr> <th>Version</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr> <td>5.5.0</td> <td> Logo GUIDs were replaced with data URIs, and so turning off expose_php now has no effect on the result of phpinfo(). Credits are also now embedded within the output itself instead of linked. </td> </tr> <tr> <td>5.2.2</td> <td> The "Loaded Configuration File" information was added, when before only "Configuration File (php.ini) Path" existed. </td> </tr> </tbody> </table> </p> </div> <div class="refsect1 examples" id="refsect1-function.phpinfo-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-514"> <p><strong>Example #1 <span class="function"><strong>phpinfo()</strong></span> Example</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br /><br /></span><span style="color: #FF8000">// Show all information, defaults to INFO_ALL<br /></span><span style="color: #0000BB">phpinfo</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">// Show just the module information.<br />// phpinfo(8) yields identical results.<br /></span><span style="color: #0000BB">phpinfo</span><span style="color: #007700">(</span><span style="color: #0000BB">INFO_MODULES</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> </div> </p> </div> <div class="refsect1 notes" id="refsect1-function.phpinfo-notes"> <h3 class="title">Notes</h3> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> In versions of PHP before 5.5, parts of the information displayed are disabled when the <a href="ini.core.html#ini.expose-php" class="link">expose_php</a> configuration setting is set to <em>off</em>. This includes the PHP and Zend logos, and the credits. </p> </p></blockquote> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> <span class="function"><strong>phpinfo()</strong></span> outputs plain text instead of HTML when using the CLI mode. </p> </p></blockquote> </div> <div class="refsect1 seealso" id="refsect1-function.phpinfo-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="function"><a href="function.phpversion.html" class="function" rel="rdfs-seeAlso">phpversion()</a> - Gets the current PHP version</span></li> <li class="member"> <span class="function"><a href="function.phpcredits.html" class="function" rel="rdfs-seeAlso">phpcredits()</a> - Prints out the credits for PHP</span></li> <li class="member"> <span class="function"><a href="function.php-logo-guid.html" class="function" rel="rdfs-seeAlso">php_logo_guid()</a> - Gets the logo guid</span></li> <li class="member"> <span class="function"><a href="function.ini-get.html" class="function" rel="rdfs-seeAlso">ini_get()</a> - Gets the value of a configuration option</span></li> <li class="member"> <span class="function"><a href="function.ini-set.html" class="function" rel="rdfs-seeAlso">ini_set()</a> - Sets the value of a configuration option</span></li> <li class="member"> <span class="function"><a href="function.get-loaded-extensions.html" class="function" rel="rdfs-seeAlso">get_loaded_extensions()</a> - Returns an array with the names of all modules compiled and loaded</span></li> <li class="member"><a href="language.variables.predefined.html" class="link">Predefined Variables</a></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.phpcredits.html">phpcredits</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.phpversion.html">phpversion</a></div> <div class="up"><a href="ref.info.html">PHP Options/Info Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>