Follow

How can I create a phpinfo.php page?

  • Applies to: Grid
    • Difficulty: Easy
    • Time Needed: 10
    • Tools Required: FTP, plain text editor
  • Applies to: All DV
    • Difficulty: Easy
    • Time Needed: 10
    • Tools Required: FTP, plain text editor

Last modified: March 10, 2020

Overview

You can use a phpinfo() page to view the current PHP information for your server.

This file outputs a large amount of information, such as:

  • Information about PHP compilation options and extensions
  • PHP version
  • Server information and environment (if compiled as a module)
  • PHP environment
  • OS version information, paths, master and local values of configuration options
  • HTTP headers
  • PHP license

Because every system is set up differently, phpinfo() is commonly used to check PHP configuration settings and for available predefined variables on your particular system.

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

Create a phpinfo.php page

Luckily, creating a phpinfo page can be performed fairly quickly and easily!

  1. Open your website files using a File Manager, FTP, or SSH.
  2. Navigate to your website's root directory. This generally will be:
    • Plesk: httpdocs
    • cPanel: public_html
  3. Create a new file named phpinfo.php in your associated website root directly
    You do have the option to add this file into any subdirectory of your choosing.
  4. Add the following lines into your phpinfo.php file:
    <?php

    // Show all information, defaults to INFO_ALL
    phpinfo();

    ?>
  5.  Save your edits.
  6. You have just created a php info page! Feel free to continue through this article for instructions on how to view your page.

Create a phpinfo.php page

Luckily, creating a phpinfo page can be performed fairly quickly and easily! In this example we will be using the Grid's File Manager.

  1. Log into your Media Temple Account.
  2. Navigate to the File Manager.
  3. Navigate to your website's root directory. For the Grid this will be your website's /html folder.

    g1.png
  4. Click on NEW FILE.

    G2.png
  5. Name the file phpinfo.php.

    g3.png
  6. Add the following lines into your phpinfo.php file:
    <?php

    // Show all information, defaults to INFO_ALL
    phpinfo();

    ?>
  7.  Save your edits.
  8. You have just created a php info page! Feel free to continue through this article for instructions on how to view your page.

Instructions

  1. Open File Manager for your Shared Hosting server.
  2. Navigate to the /public_html folder.
  3. Create a new file called phpinfo.php
  4. Edit the phpinfo.php page and add the following lines:
    <?php

    // Show all information, defaults to INFO_ALL

    phpinfo();

    ?>
  5. Save your changes.

View your phpinfo page

  1. To view your php info page, open a browser and go to the URL http://www.example.co/phpinfo.php

    Replacing example.com with your actual domain name

    g5.png

    The php info page will be under example.com/phpinfo.php assuming you uploaded the file to your website root directory.

  2. You can view all of the information about PHP for your server for that particular directory.
  3. If you'd like to search for a specific module or resource limit, you can press the following keys:
    • Windows: CTLR + F
    • Mac: CMD + F
  4. Then type the name of the module or resource in question.

    g6.png
  5. That's it! You should now know how to create, view, and search through a phpinfo.php page!

More about PHP

http://us.php.net/

Was this article helpful?
0 out of 1 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk