An info.php file is a simple way to view your server’s PHP version, enabled extensions, and configuration details. It is commonly used for troubleshooting or verifying hosting settings.
What the info.php File Does
The file contains a single PHP command:
When accessed in a browser, the server displays detailed PHP configuration information.
Option 1: Using cPanel File Manager
- Log in to cPanel.
- Open File Manager.
- Navigate to your website’s root folder, usually
public_html. - Create a new file named
info.php. - Edit the file and paste the following code:
<?php phpinfo(); ?>
Save the file and visit https://yourdomain.com/info.php in your browser.
Option 2: Using DirectAdmin File Manager
- Log in to DirectAdmin.
- Open File Manager.
- Navigate to your site’s main directory, typically
public_htmlordomains/yourdomain.com/public_html. - Create a new file named
info.php. - Add the following content to the file:
<?php phpinfo(); ?>
Save the file and open https://yourdomain.com/info.php.
Option 3: Using an FTP Program
- Connect to your server using an FTP client such as FileZilla.
- Navigate to your website’s root folder.
- Create a new file named
info.php. - Add the following code:
<?php phpinfo(); ?>
Upload the file if needed and visit https://yourdomain.com/info.php to view the results.
Important Security Note
Delete the info.php file once you are finished. Leaving it online can expose sensitive server configuration details.