Website Security

How to Check Your PHP Version in Every Situation

There is more than one place to read your PHP version, and they do not always agree. This guide covers WordPress, hosting panels, the command line, a phpinfo page and XAMPP, then shows how to read a number like 8.3.36 against the October 2026 fixes. Sources read 22 October 2026.

How to Check Your PHP Version in Every Situation

Key takeaways

  • The version has three parts. In 8.3.36, the 8.3 is the branch and the 36 is the patch number. The October 2026 security fixes are patch numbers, so both parts matter.
  • Fixed releases are the fixed version for your branch. php.net announced these on 21 October 2026. A lower patch number on the same branch is below the fix.
  • WordPress Site Health is the fastest check for a WordPress owner. It reads the PHP your website really runs on, and we keep that part short because a separate guide covers it.
  • The command line can show a different PHP from your website. A server can hold several PHP versions, and the one your terminal calls may not be the one your site uses.
  • Delete any phpinfo page when you are done. Its output is detailed server information that should not sit on a live site.
  • A version number alone is not a verdict. Some Linux vendors patch an older version without changing its number, so ask your host in writing if the number looks old.

The quick answer

In the WordPress admin, the Server block of the Info tab under Site Health lists it. On a hosting panel, look for a PHP or MultiPHP setting. With a terminal, type php -v. If none of that is open to you, ask your host. For why the number matters now, see our main guide to the PHP vulnerability of October 2026.

Which method should you use?

MethodWho it suitsThe catch
WordPress Site HealthWordPress owners with dashboard accessOnly works for WordPress sites, and only if you can log in
Hosting control panel (cPanel, hPanel and similar)Anyone with a hosting loginLayouts differ by host, and some plans hide the setting
Command line (php -v)Developers and people with server or local terminal accessMay show the terminal's PHP, not the one your website uses
A phpinfo pageAnyone who can upload a file to the siteExposes server details, so it must be deleted straight after
XAMPP or other local toolsPeople building on their own computerShows your computer's PHP, not your live site's
Ask your host in writingEveryone who is stuckSlower, but it gives you a record

Method 1: WordPress Site Health

In the dashboard, go to Tools, then Site Health, click the Info tab, open the Server section and find the PHP version. WordPress.org gives this exact route on its page about updating PHP, and it says that a number of 8.3 or higher means no update is needed on its own advice.

For the October 2026 flaws you also need the right patch number. Our guide to checking and updating PHP on WordPress covers backups, testing and the host switch.

Method 2: your hosting control panel

Most shared hosts show the PHP version in the panel, and they usually let you change it too.

cPanel. cPanel's documentation describes a tool called MultiPHP Manager. It lists each domain on the account with its current PHP version, whether it inherits the server default, and whether PHP-FPM is on. To change a version, you tick the domain, pick a version from the menu and click Apply. The documentation also says that if a version is missing from the menu, the server does not have it installed or your account cannot use it, and the server administrator can add it. Hostinger. Hostinger's help page says to open the Websites section in hPanel, click Dashboard for the site, then choose PHP Configuration in the sidebar. You pick a version and click Update, and the change usually takes a few minutes. The page says the choice applies to every website on that hosting plan, with an exception for sites made with its AI Builder. It also says versions 8.1 and below are no longer offered, and that existing sites on older versions can move up but cannot go down.

Other hosts. Search your host's help centre for "PHP version", or ask support which version your domain uses. Per the cPanel documentation, versions are set per domain, so check every domain you care about.

Method 3: the command line

The command line works on Windows (Command Prompt or PowerShell), macOS and Linux, and over SSH on a server.

`` php -v ``

The php.net manual says the -v option prints the PHP and Zend Engine version information and then exits. The first line also names the SAPI, such as cli. SAPI is the way PHP is being run, and cli means command line.

For just the number, php.net documents the -r option, which runs a short piece of PHP straight from the command line:

`` php -r 'echo PHP_VERSION;' ``

The manual advises single quotes so your shell does not expand dollar signs inside the code. php.net's user notes say Windows needs double quotes instead, so on Windows write php -r "echo PHP_VERSION;". The PHP_VERSION constant holds the same string as the phpversion() function, per the manual.

If the command is not found, PHP may not be installed on that machine, or the terminal cannot locate it. Use another method.

The big catch. A server can have several PHP versions installed side by side. The terminal runs one of them. Your website, served through Apache or another web server, may run a different one. This matches what the cPanel documentation shows, where each domain can have its own version. So if php -v says 8.4.27 but your hosting panel says 8.1, trust the panel for the website, and ask your host to confirm.

Method 4: a phpinfo page

A phpinfo page shows what PHP is doing for the web server itself, so it reads the version the website really uses. You create a file, for example info.php, containing a single line that calls the phpinfo() function, upload it to your site and open it in a browser. The version appears near the top.

The php.net manual says phpinfo() prints a large report: the build, the configuration file location, the web server, loaded modules, environment variables and request data. That is a lot of detail about your server, so delete the file the moment you have read the number. Anyone who finds it learns more than they should.

Prefer Site Health or the panel when you can. Use phpinfo only as a fallback.

Method 5: XAMPP and local setups

XAMPP runs PHP on your own computer. The Apache Friends help pages describe two useful things. You can open the XAMPP Control Panel and launch the XAMPP Shell from it, which gives you a command prompt where php -v works. And you can visit http://localhost/xampp/phpinfo.php to see the PHP settings, including which php.ini file is in use.

This is the PHP on your computer, not your live site. If the two differ, a site can work locally and break once live, so check both.

How to read a version like 8.3.36

PHP versions have three parts, separated by dots.

PartExample in 8.3.36What it means
Major8A big generation of PHP
Minor3The branch. 8.3 and 8.4 are different branches with different end dates
Patch36Bug and security fixes inside a branch. Higher is newer

Now compare yours with the releases that fixed the two critical flaws, as announced by php.net on 21 October 2026:

Your branchFixed in (php.net)What to do if you are lower
8.58.5.12Update to 8.5.12 or newer
8.48.4.27Update to 8.4.27 or newer
8.38.3.36Update to 8.3.36 or newer
8.28.2.35Update to 8.2.35 or newer, and plan a move to a newer branch
8.1 and olderNo fix from the PHP projectAsk your host about a vendor backport, or move to a supported branch

So 8.3.36 is a fixed release, 8.3.35 is not, and 8.4.1 is far below 8.4.27. Your patch number needs to be equal to or higher than the one in the table for your branch.

Two cautions. First, php.net says PHP 8.1 and older no longer get updates from the project, though some Linux distributions and long-term support vendors supplied fixes. A host using one of those may show a low number while the fix is in. Second, a number is only a starting point. Our guide to what to ask your web host about the PHP security fix lists the questions that settle it.

For which branch to aim for in the longer run, see our post on PHP end of life dates, and for what WordPress itself needs, read WordPress minimum PHP version.

How we help

If reading version numbers is not how you want to spend your week, we can look after it. We build and maintain WordPress sites, and we do the checks, backups and updates as a routine job. See our WordPress development and Webflow maintenance pages. If you would rather have no PHP to watch at all, Webflow migration moves a WordPress site to a hosted builder, keeping your URLs.

Frequently asked questions

How do I check my PHP version in cmd?

Open Command Prompt and type php -v. If it prints a version, that is the PHP your terminal uses. If it says the command is not recognised, PHP is not installed there or the terminal cannot find it. Remember this may differ from the PHP your live website uses.

How do I check my PHP version in Linux?

Open a terminal, or connect to your server over SSH, and type php -v. For only the number, use php -r 'echo PHP_VERSION;'. On a shared host, check the panel too, because the website's version can differ from the terminal's.

How do I check my PHP version in XAMPP?

Open the XAMPP Control Panel, start the XAMPP Shell and type php -v. You can also open http://localhost/xampp/phpinfo.php. Both show your local PHP, not your live site.

How do I check my PHP version in WordPress?

Open Site Health, pick the Info tab and expand Server.

Is it safe to use a phpinfo page?

Only briefly. It prints detailed server information, so delete the file as soon as you have the version.

Why does my terminal show a different PHP from my site?

A server can carry several PHP versions, and each domain can use its own. Trust the panel, Site Health or a phpinfo page for the website.

Is my site safe if the version number is high enough?

It is a good sign, not a guarantee. A version at or above the fixed release removes those two known flaws, but you still need updated plugins, themes and sound hosting. Ask your host in writing if you are unsure.

Rahat Khondokar, founder of Amariq

Rahat Khondokar

Founder & CEO, Amariq

Rahat designs and builds websites for marketing teams and ecommerce brands, and writes here about the structure, copy and conversion work behind them. More about Amariq. Find him on YouTube, Dribbble and LinkedIn.

Keep reading

Related articles.

All articles