Home CPANEL WEB HOSTING How to Create a phpinfo

How to Create a phpinfo

Last updated on Apr 08, 2024

Creating a phpinfo page is an essential task for anyone managing a website, especially for WordPress users who might not be developers but still need to keep their site running smoothly. The phpinfo() function is a powerful PHP feature that displays your site's current PHP configuration, providing detailed information about the PHP environment, including versions, extensions, and server data. This can be particularly useful for debugging or ensuring your server meets the requirements for specific applications.

How to Create a phpinfo Page

  1. Log into Your cPanel: Access your Hostyt cPanel account to begin the process.

  2. Access File Manager: Navigate to the Files section and open the File Manager.

  3. Navigate to the Public_html Folder: Choose the directory where you want the phpinfo page to be accessible.

  4. Create a New File: Click the +File button at the top menu and name the file phpinfo.php or any other name you prefer, keeping the .php extension.

  5. Edit the New File: Locate the phpinfo.php file in your file list, right-click on it, and select Edit.

  6. Insert the phpinfo() Code: Paste the following PHP code into your file:
    <?php phpinfo(); ?>

  7. Save Your Changes: After entering the code, click Save Changes to update the file.

Viewing Your PHP Settings

To access your phpinfo page and view your PHP configuration:

  • Open a web browser and visit https://yourdomain.com/phpinfo.php, replacing "yourdomain.com" with your actual domain name.

  • Use the browser's search function to find specific PHP settings or values you're interested in.

Important Security Note

The phpinfo page contains sensitive information about your PHP environment. To protect your site:

  • Delete the phpinfo Page: Remove the file when you no longer need it to prevent unauthorized access.

  • Rename the File: If you prefer not to delete it, consider renaming the file to something unique and less predictable than phpinfo.php to avoid detection by bots. Remember to choose a name you can recall easily.

By following these steps, you've successfully created a phpinfo page on your Hostyt hosting account, allowing you to check your PHP settings conveniently from your web browser.