How to Check PHP Version in WordPress, Linux, Ubuntu, Windows, XAMPP, and cPanel


How to check php version (1)
Image source: PHP

Two critical PHP vulnerabilities have put websites and applications running vulnerable server configurations at risk. Tracked as CVE-2026-109618 and CVE-2026-109619, the vulnerabilities could allow unauthenticated attackers to execute malicious code remotely. Here’s how to check your website’s PHP version and determine whether it needs an urgent security update.

How to Check PHP Version on Website

If you want to check your website’s PHP version, start with your hosting dashboard. This shows the PHP configuration assigned to your website, rather than a separate version installed on your computer.

  1. Log in to your web hosting account.
  2. Open your hosting control panel.
  3. Look for PHP Manager, Select PHP Version, or MultiPHP Manager.
  4. Select your website’s domain.
  5. Check the PHP version assigned to it.

If you manage a VPS or dedicated server, use SSH to inspect the web server’s PHP configuration. Remember that command-line PHP and the PHP version serving website requests can differ.

How to Check PHP Version in WordPress

WordPress provides a built-in way to check your website’s PHP version without installing another plugin.

  1. Sign in to your WordPress admin dashboard.
  2. Navigate to Tools > Site Health.
  3. Open the Info tab.
  4. Expand the Server section.
  5. Find the PHP version entry.

WordPress also displays other server details that can help diagnose compatibility issues. You can consult the official WordPress Site Health documentation for additional information.

If you manage several WordPress websites, check each installation separately. Different domains can use different PHP versions, even when they share the same hosting account.

How to Check PHP Version in cPanel

cPanel offers several tools for checking and managing PHP versions. The exact options depend on your hosting provider’s configuration.

  1. Log in to cPanel.
  2. Open Software > MultiPHP Manager, if available.
  3. Locate your domain.
  4. Check the PHP version assigned to it.

Some hosts instead provide Select PHP Version or a separate PHP configuration page. If you cannot find these options, contact your hosting provider.

You can also consult the official cPanel MultiPHP Manager guide.

How to Check PHP Version in Linux

Linux users can check their installed PHP version directly from the terminal.

  1. Open Terminal.
  2. Run the following command
php -v

The output shows the PHP version used by the command-line executable, along with build information.

To check which PHP executable is being used, run:

which php

On systems using multiple PHP versions, you might have separate executables for different releases. The command-line version also might differ from the PHP version configured for Apache or PHP-FPM.

How to Check PHP Version in Ubuntu

Ubuntu users can use the same basic command to check their PHP installation.

php -v

To see whether PHP packages are installed, run:

dpkg -l | grep php

This lists installed packages whose names contain php. It can reveal installed PHP versions and related components.

If your Ubuntu server runs a website, check its web-serving PHP package as well. For example, PHP-FPM and Apache modules may have separate package names.

You can inspect PHP-FPM services using:

systemctl list-units --type=service | grep php

Package versions may differ from upstream PHP version numbers because Linux distributions can backport security fixes. Check your distribution’s security advisory before concluding that a package remains vulnerable.

How to Check PHP Version in Windows

Windows users can check PHP through Command Prompt or PowerShell, provided PHP is installed and available in the system PATH.

  1. Open the Start menu.
  2. Search for Command Prompt or PowerShell.
  3. Open the application.
  4. Enter this command.
php -v

If PHP is installed and configured correctly, Windows displays its version.

If Windows reports that php is not recognized, PHP might not be installed or its executable directory might not be included in the PATH environment variable. You can also navigate to the PHP installation folder and run php.exe -v directly.

How to Check PHP Version in CMD

You can check the PHP version using Windows Command Prompt with one command.

php -v

To locate the PHP executable, run:

where php

If multiple PHP installations appear, the first executable found through PATH is normally the one used when you run php -v.

This method checks the command-line installation. It does not automatically confirm which PHP version an IIS website or another local web server uses.

How to Check PHP Version in XAMPP

XAMPP includes PHP, so you can check its version through the bundled command-line executable.

  1. Open File Explorer.
  2. Navigate to your XAMPP installation folder, usually C:\xampp.
  3. Open the php folder.
  4. Locate php.exe.
  5. Open Command Prompt and run the following command, adjusting the path if necessary.
C:\xampp\php\php.exe -v

You can also open the XAMPP Control Panel and start Apache to test your local website.

For a browser-based check, create a temporary PHP file in your website’s document root containing:

<?php
echo PHP_VERSION;

Save it as php-version.php and open http://localhost/php-version.php in your browser.

Delete the file immediately after checking. Do not publish a PHP information page on a public website because it can expose details about your server.

How to Check PHP Version in Linux and Windows if PHP Is Installed

If you are unsure whether PHP is installed, try the version command first.

On Linux, open Terminal and run:

php -v

On Windows, open Command Prompt and run:

php -v

If PHP is installed and available through PATH, the command displays its version. Otherwise, you may receive an error indicating that the command cannot be found.

On Ubuntu, you can check installed packages with dpkg -l | grep php. On Windows, search for an existing PHP installation folder or check your development environment, such as XAMPP.

A missing command does not necessarily mean your website lacks PHP. Your hosting server could run PHP remotely, even when PHP is not installed on your personal computer.

Which PHP Versions Fix the Latest Security Vulnerabilities?

The PHP team released patched versions for CVE-2026-109618 and CVE-2026-109619 on October 21, 2026. These flaws can allow unauthenticated remote code execution on vulnerable systems. <Cite refs={[“turn283929search4″,”turn283929search8”]}/>

PHP branchPatched release
PHP 8.58.5.12
PHP 8.48.4.27
PHP 8.38.3.36
PHP 8.28.2.35

If your website runs an earlier version in one of these branches, update it to the corresponding patched release or a later fixed release. PHP 8.1 and older are no longer supported by the upstream PHP project. Some distributions and vendors provide backported fixes, so check their security advisories.

What to Do After Checking Your PHP Version

If your website uses an affected release, back up your files and database before updating PHP. Use your hosting dashboard or contact your hosting provider if you cannot manage the version yourself. After updating, test your website’s important pages, forms, plugins, and integrations. If your site uses a managed hosting service, confirm that the actual web-serving PHP runtime has received the fix.

More about the topics: Cybersecurity, php, website

Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team. Read more

User forum

0 messages