How To Create And View Phpinfo File In cPanel?

What is the phpinfo function?
PHPinfo is an important and useful function of PHP to return compiled information. It includes information about PHP compilation options and extensive versions, server information and environment, PHP environment, OS version information, paths, HTTP headers, and the PHP license. You can also get PHP information not only from the browser but also from the command line. Here we will create a Phpinfo file in cPanel.

Steps to create and view phpinfo file in cPanel.

  1. Login to your cPanel account.
  2. Under the Files section, open File Manager.
    cpanel file manager
  3. In the new tab, go to the public_html folder from the file and folder list.
    cpanel public_html

  4. From the header menu, click on File+ to create a new file.
    cpanel create file
  5. On the pop-up menu, give the file name phpinfo.php in the public_html folder. This will create a new file.
    cpanel create new file
  6. Right-click and select Edit the phpinfo.php file.
    cpanel edit file
  7. In the pop-up windows click on Edit.
    cpanel edit
  8. This will open the empty file and you need to insert the below code.
  9. <?php
    phpinfo();
    ?>
  10. Once you insert the above code, click on the Save Changes button.
    cpanel save file
  11. Now, we have created a phpinfo file. So, it is time to view that file.
  12. To view the phpinfo.php file, kindly go to any browser and type in the URL section website IP Address/~cPanelusername/phpinfo.php. It will return the PHP information like version and environment.

This is how you create and view the PHPInfo file in cPanel.

If you enjoyed this tutorial, then you would love our support! All Kemuhost hosting plans include 24/7 support from our amazing support team. Check out our web hosting plans and have your website migrated for free today!

Add a Comment

Your email address will not be published. Required fields are marked *