Knowledge Base

How to create a phpinfo file to view your PHP settings

Knowing which Hypertext Preprocessor (PHP) version, extensions, and settings your hosting plan uses helps you troubleshoot errors, check compatibility, and confirm that a change took effect. A phpinfo file is a small PHP file that displays all these details on a single page in your browser.

Note: A phpinfo file only displays your PHP settings. To change a setting, such as the memory limit, you must update your PHP configuration separately.

In this article, we will discuss:

What a phpinfo file shows

The phpinfo file runs a built-in PHP function called phpinfo(). When you open the file in your browser, it generates a page that lists the PHP configuration for your hosting. Common details include:

  • PHP version: The version currently running on your hosting
  • Loaded configuration file: The location of the php.ini file in use
  • Core settings: Values such as memory_limit, max_execution_time, and upload_max_filesize
  • Extensions: The PHP modules that are installed and enabled

 

Creating the phpinfo file

You can create the file on your computer using any plain text editor, such as Notepad on Windows or TextEdit on Mac. Do not use a word processor, because it can add formatting that breaks the code.

  1. Open a plain text editor and create a new file.
  2. Copy and paste the following line of code into the file:

    <?php phpinfo(); ?>
     
  3. Save the file as info.php.
Note: Make sure the file extension is .php and not .txt. If your editor adds .txt automatically, rename the file so it ends in .php.

 

Uploading the file to your hosting

Upload the file to the root directory of the website where you want to check the PHP settings. We recommend using Secure File Transfer Protocol (SFTP) instead of File Transfer Protocol (FTP) because SFTP encrypts your login credentials and files while they are in transit. You can also use the file manager tool available for your hosting plan.

For instructions on configuring and connecting via SFTP, please see How to configure SFTP on Network Solutions article.

  1. Connect to your hosting using your SFTP client or file manager.
  2. Open the root directory of your website.
  3. Upload the info.php file to this directory.
Important: If your account has more than one website, upload the file to the root directory of the specific website you want to check. The settings shown depend on where the file is loaded from.

Our support team is here to help if you need assistance with any of these steps.

 

Viewing your PHP settings

  1. Open your web browser.
  2. Go to yourdomain.com/info.php, replacing yourdomain.com with your actual domain name.
  3. Review the page that appears. Use your browser’s search function (Ctrl+F on Windows or Command+F on Mac) to find a specific setting, such as memory_limit.

If you see a blank page, a download prompt, or the code itself instead of the settings page, check that the file name ends in .php and that the code was copied exactly as shown.

 

Deleting the file after use

Once you have the information you need, delete the info.php file from your hosting.

Important: Do not leave the phpinfo file on your website. Anyone who knows or guesses the file name can view details about your server configuration, which can be used to find ways to attack your website.
  1. Connect to your hosting using your SFTP client or file manager.
  2. Open the root directory where you uploaded the file.
  3. Delete the info.php file.

 

Review

A phpinfo file is a quick way to see your PHP version, loaded configuration file, settings, and extensions in one place. Create the file with a single line of code, upload it to your website’s root directory using SFTP, and open it in your browser to view the details. To keep your website secure, always delete the file as soon as you finish.

 

Related articles

 

Get practical tips and product updates on LinkedIn.
Follow Network Solutions