How to Create a phpinfo File
Creating a phpinfo
file is a quick and easy way to view your server’s PHP configuration, including version, extensions, and environment settings. This is useful for troubleshooting or verifying that certain PHP settings are enabled.
Steps to Create a phpinfo File:
-
Log in to cPanel and open the File Manager.
-
Navigate to the folder where you want to place the file (usually
public_html
). -
Click + File to create a new file and name it:
phpinfo.php
-
Open the new file and add the following code:
<?php phpinfo(); ?>
-
Click Save Changes and close the editor.
-
Visit the file in your browser, for example:
https://yourdomain.com/phpinfo.php
You’ll see a detailed page showing all current PHP settings on your server.
Important:
Delete the phpinfo.php
file when you're done. Leaving it publicly accessible can expose sensitive server information.