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.
- Login to your cPanel account.
- Under the Files section, open File Manager.
- In the new tab, go to the public_html folder from the file and folder list.
- From the header menu, click on File+ to create a new file.
- On the pop-up menu, give the file name phpinfo.php in the public_html folder. This will create a new file.
- Right-click and select Edit the phpinfo.php file.
- In the pop-up windows click on Edit.
- This will open the empty file and you need to insert the below code.
- Once you insert the above code, click on the Save Changes button.
- Now, we have created a phpinfo file. So, it is time to view that file.
- 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.
<?php
phpinfo();
?>
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!