Loading...

Knowledge Base

How to Check PHP Version and Info via Customer Portal or cPanel

PHP is the server-side scripting language that powers many websites and web applications, including WordPress. Your website's PHP environment determines how PHP code is processed and can affect your site's performance, compatibility, and functionality. If you need to check your PHP version or review your server's PHP configuration, you can do so directly through the Customer Portal. 

This article explains what PHP is, how to check your site's PHP version and view PHP information from the Customer Portal, where to find additional PHP details, and an alternative method using cPanel.

Here are the topics discussed in this article:

What are the Benefits of Using the Latest PHP Version?

Old PHP could leave your website exposed to possible security attacks. You could also be missing out on features like improved security and performance. We recommend that you stay up to date with the latest PHP so that your website runs smoothly and is ready for future website development. That being said, it is still essential to make sure your PHP version is compatible with your website's scripts and components before you upgrade. Currently, the latest PHP version available in the Customer Portal is 8.5.

How to Check Your PHP Version and View PHP Information

You can check your PHP version and view PHP information directly from the Customer Portal without accessing cPanel.

  1. Log in to your Customer Portal.
  2. Go to Websites from the left navigation menu.
  3. Click Manage Site next to the website you want to manage.

    Edit Site button
     

  1. Click the Advanced tab.
  2. Under the PHP Version card, you will see the current PHP version of your website.

    HostGator - Current PHP Version
     

  3. To view the PHP Info page, click View PHP Version Info.

    HostGator - View PHP Version Info
     

  4. You'll be redirected to the PHP Info page, where you'll find the currently active PHP version at the top. You can use this page to check specific PHP settings, such as memory_limit, max_execution_time, and upload_max_filesize, further down the list.
Warning! The PHP Info page can expose sensitive server details. Never share this page publicly.

Alternative Method: Create and View a phpinfo.php File in cPanel

If you prefer to work in cPanel, or need to check PHP details for a specific directory, you can create a phpinfo.php file instead. This method is optional. The Customer Portal steps above covers most needs without requiring access to cPanel.

What phpinfo()?

phpinfo() is a built-in PHP function that outputs a detailed summary of your server's PHP configuration. This includes the installed PHP version, loaded extensions and modules, and the values of settings, such as memory_limit. It is the fastest way to confirm exactly what PHP environment your site is running in.

How to Create a phpinfo.php File

  1. Log in to your Customer Portal.
  2. Go to Websites from the left navigation menu.
  3. Click Manage Site next to the website you want to manage.

    Edit Site button
     

  4. Navigate to the Files & Access tab.
  5. Find the File Manager, then click the Manage button.

    Customer Portal - File Manager  card
     

  1. Locate and select public_html from the list.
  2. At the top-right menu, click +File.

    cPanel - + File
     

  3. In the pop-up window, enter phpinfo.php as the file name. While you can use another file name, "phpinfo.php" is commonly used for this purpose.
  4. Click Create New File.

    New phpinfo file - Create new file
     

  5. Locate and right-click phpinfo.php from your list of files.
  6. Select Edit.

    New phpinfo file - Edit phpinfo.php
     

  7. In the pop-up, click Edit once again.
  8. Enter one of the following selections of code into the phpinfo.php file:

    Show All PHP Information

    #Use the following code to show all the information about PHP.
    <?php
    phpinfo();
    // This would be used to display all of the PHP information available for the installation.
    ?>

    Show Installed Modules

    #Use the following code to see the installed modules and their current values.
    <?php
    phpinfo(INFO_MODULES);
    // This would be used to display the installed modules and their current values.
    ?>

    Show php.ini Configurations

    #Use the following code to display the configurations you have set up through your php.ini or to review what's set up through the default configurations.
    <?php
    phpinfo(INFO_CONFIGURATION);
    // This would be used to display the configurations you have set up through your php.ini or to review what's set up through the default configurations.
    ?>
  9. Click Save Changes.

How to View the phpinfo.php File

  1. Open an internet browser.
  2. Type the following into your browser's address bar:
    http://example.com/phpinfo.php

    Replace "example.com" with your actual domain name.

  3. The site's active PHP version is displayed at the top of the PHP Info page.

    Sample URL

How to Change PHP Version and Settings

You can update your site's PHP version through either the Customer Portal or cPanel.

For detailed instructions, see How Do I Update the PHP Version on My Site.

How can we help you? Please contact us via phone or chat if you need assistance.

Loading...