Knowledgebase

What Are the Benefits of Using the Latest PHP Version?

Old PHP could leave your website exposed to possible security attacks. And you could be missing out on features like improved security and performance. We recommend that you stay up to date with the latest PHP so that your website runs smoothly and is ready for future website development. That being said, it is still essential to make sure your PHP version is compatible with your website’s scripts and components.

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.
	?> 

Click Save Changes.

  • PHP
  • 27 Users Found This Useful
Was this answer helpful?