Viewing your site's PHP version and settings

 

Overview

The following explains how to use a phpinfo.php file to view the version of PHP your site is running.

Background

The PHP language has a special built-in function called phpinfo() that retrieves information about the PHP environment running on a website. You can view this information by creating a phpinfo.php file. When viewed in a browser, details such as the following display:

  • PHP version
  • PHP extensions
  • Paths
  • Local values of configuration options

How to create a phpinfo.php file

This section explains how to create this file on your web server using FTP or SSH.

Using FTP

  1. Log into your server using an FTP client such as Filezilla.
  2. Create a blank file titled phpinfo.php. Ensure it has the .php extension and not a .txt extension.
  3. Edit this phpinfo.php file and add the following lines:
    <?php 
    phpinfo();
    ?>
  4. Visit the file in a browser. For example, example.com/phpinfo.php.

The page lists all PHP settings currently used on your website.

Using SSH

  1. Log into your server via SSH.
  2. Change into your website directory.
  3. Create a file named phpinfo.php.
  4. Add the following lines to this file:
    <?php 
    phpinfo();
    ?>
  5. Save the file and return to your shell.
  6. Visit the file in a browser. For example, example.com/phpinfo.php.

The page lists all PHP settings currently used on your website.

See also

Dreamhost links

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?