What version of PHP is my site using?


PHP also has a special function that can retrieve information about a particular installation of itself, and the environment in which it has been installed. To retrieve this information, all you have to do is save the following in a text file with a .php extension, upload the file to a web server, and then view it with a conventional web browser.

For example, you can create a file called phpinfo.php with the following content and then view it at example.com/phpinfo.php:


Once you visit the page, the following results appear:

  • 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.

See also

Did this article answer your questions?

Article last updated PST.