In the phpinfo.php page, the PHP version can be seen at the top of the file, listing the current version of MySQL being used.
You can also use phpinfo to check specific php settings such as safe_mode and register_globals.
How to Create a phpinfo File
- In the public_html folder of your site, create a file named phpinfo.php.
- Insert one of the following selections of code into the phpinfo.php file:
- 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.
?>
- 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.
?>
- Use the following code to display the configurations you have set up through your php.ini or to review what's setup through the default configurations.
<?php
phpinfo(INFO_CONFIGURATION); // This would be used to display the configurations you have setup through your php.ini or to review what's setup through the default configurations.
?>
- Use the following code to show all the information about PHP.
- Open an internet browser.
- Type the following into your browser's address bar:
http://example.com/phpinfo.php
Be sure to replace "example.com" with your actual domain.