In the phpinfo.php page, the PHP version can be seen at the top of the file as well as the current MySQL version.
You can also use phpinfo to check specific PHP settings such as safe_mode.
Jump to a Section:
- How to Create a phpinfo.php File
- How To Change Your PHP Version and Settings
- How to View the phpinfo.php File
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
- In the public_html folder of your site, create a file named phpinfo.php. For addon domains, create the phpinfo.php file inside its directory root.
- Insert 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. ?>
How To Change Your PHP Version and Settings
The cPanel gives you the ability to change your website’s current PHP version. This is done through cPanel’s MultiPHP Manager. To know more about how to change your PHP version, please check out this video guide.
Aside from updating the PHP version, the cPanel also has the ability to change your PHP settings. Please refer to this article for instructions on how to change your PHP settings.
How to View the phpinfo.php File
- Open an internet browser.
- Type the following into your browser’s address bar.
*Be sure to replace "example.com" with your actual domain name.