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!
- Open your website files using FTP, or SSH.
- Navigate to your website's root directory. This should be:
- Managed WordPress: /html
- 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. - Add the following lines into your phpinfo.php file:
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?> -
Save your edits.
- 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!
- Open your website files using a File Manager, FTP, or SSH.
- Navigate to your website's root directory. This generally will be:
- Plesk: httpdocs
- cPanel: public_html
- 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. - Add the following lines into your phpinfo.php file:
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?> -
Save your edits.
- 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.
- Log into your Media Temple Account.
- Navigate to the File Manager.
- Navigate to your website's root directory. For the Grid this will be your website's /html folder.
- Click on NEW FILE.
- Name the file phpinfo.php.
- Add the following lines into your phpinfo.php file:
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?> -
Save your edits.
- You have just created a php info page! Feel free to continue through this article for instructions on how to view your page.
Instructions
- Open File Manager for your Shared Hosting server.
- Navigate to the /public_html folder.
- Create a new file called phpinfo.php
- Edit the phpinfo.php page and add the following lines:
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?> - Save your changes.
View your phpinfo page
- 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
The php info page will be under example.com/phpinfo.php assuming you uploaded the file to your website root directory.
- You can view all of the information about PHP for your server for that particular directory.
- 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
- Then type the name of the module or resource in question.
- That's it! You should now know how to create, view, and search through a phpinfo.php page!