Skip to main content

How to Create and Remove a PHP Information Page Safely

You can create a PHP information page to view the configuration details of your website's PHP environment.

You can create a PHP information page to view the configuration details of your website's PHP environment. This process allows you to verify PHP versions, loaded modules, and active settings, but it must be removed after use to prevent the exposure of sensitive server information.

Important: A PHP information page reveals detailed information about your server's configuration and software. You must delete this page immediately after you finish using it to maintain your site's security.

Before you begin

You will need:

  • Access to your website's files via a File Manager or FTP client.

  • A web browser to view the resulting page.

Create a PHP information page

  1. Log in to your hosting control panel and open the File Manager.

  2. Navigate to the root directory of the website you wish to check (typically public_html or a similar folder).

  3. Create a new file and name it info.php.

  4. Open the file and enter the following code:

    <?php
    phpinfo();
    ?>

  5. Save the file.

  6. Open your web browser and navigate to the page by entering your domain followed by the filename (e.g., https://example.com/info.php).

Remove the PHP information page

To secure your site, remove the file as soon as you have finished gathering your information.

  1. Open the File Manager in your hosting control panel.

  2. Navigate to the directory where you created the file.

  3. Locate info.php.

  4. Delete the file.

Confirm the result

  • When you visit the URL of the information page, the browser should return a 404 Not Found error or a similar "page not found" message.

  • This confirms the file has been removed and is no longer accessible to the public.

Limitations

This procedure provides a comprehensive overview of the PHP environment. However, because this page reveals internal system paths and software versions, it should never be left active on a production website.

Did this answer your question?