How to create a phpinfo page

What is a phpinfo page?

A phpinfo page displays the current PHP configuration settings of your web server. If your website is developed in PHP, you’ll find the information in a phpinfo page very helpful for site planning and troubleshooting. Some of the information displayed includes:

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

Creating a phpinfo page

There are two methods you can use to create a phpinfo page: on your local computer or on the web server with cPanel.

On your local computer

Create a plain text file called phpinfo.php on your local computer using a text editor, such as Notepad on Windows or TextEdit on a Mac. Add the following line of code:

<?php phpinfo(); ?>

Save the file and use your FTP client to upload the file to your site’s home directory on the web server. For more information, see Downloading and using FTP software programs.

On the web server with cPanel

Log in to your HostPapa cPanel and click File Manager. Select your site’s home directory and click New File. Name the file phpinfo.php and click Create New File. Select the file and click Edit.

Add the following line of code and click Save Changes.

<?php phpinfo(); ?>

Viewing the output

Open the phpinfo.php page in your web browser. For example, if you saved the file in your site’s public_html directory, go to, replacing with your own domain name. You’ll see all of the PHP information for your web server.

More information

For more information, see phpinfo in the PHP.NET documentation.

And if you have any questions or need help, you can always contact HostPapa Support by opening a support ticket. Details about how to open a support ticket are here.

Related Articles

Get online with our affordable web hosting

Get online with our affordable web hosting

Learn more now
HostPapa Mustache