How to Create a phpinfo.php File for Primary Domain

  1. Log in to cPanel.
  2. In the cPanel’s Files section, click on the File Manager icon.HostGator cPanel File Manager
  3. On the next page, locate and select public_html from the list.File Manager - public_html
  4. In the top-right menu, click +File.cPanel - File Manager - New File
  5. Enter phpinfo.php when prompted to create a new file. You can actually name it anything; phpinfo.php is just commonly used for this purpose.
  6. Select the Create New File button.
  7. Locate and right-click phpinfo.php from your list of files.
  8. Select Edit.
  9. Enter one of the following selections of code into the phpinfo.php file:

    Show All PHP Information

    #Use the following code to show all the information about PHP.
    	<?php
    	phpinfo(); // This would be used to display all of the PHP information available for the installation.
    	?> 

    Show Installed Modules

    #Use the following code to see the installed modules and their current values.
    	<?php
    	phpinfo(INFO_MODULES); // This would be used to display the installed modules and their current values.
    	?> 

    Show php.ini Configurations

    #Use the following code to display the configurations you have set up through your php.ini or to review what's set up through the default configurations.
    	<?php
    	phpinfo(INFO_CONFIGURATION); // This would be used to display the configurations you have set up through your php.ini or to review what's set up through the default configurations.
    	?> 
  10. Click Save Changes.

Was this article helpful?

Related Articles