Website Security

How to Check PHP Version on Windows 11 and in XAMPP

Typing php -v is the quick answer, but on Windows it often ends in an error instead of a number. This guide walks through Command Prompt, PowerShell, the XAMPP shell and a phpinfo file, explains the not recognized message and the PATH fix, and shows why your computer's PHP is not the PHP your live site runs. Sources read 13 November 2026.

How to Check PHP Version on Windows 11 and in XAMPP

Key takeaways

  • The fastest check is one command. Open Command Prompt or PowerShell on Windows 11, type php -v and press Enter. The first line prints your version.
  • A "not recognized" error does not always mean PHP is missing. It means Windows cannot find php.exe from where you are. PHP may be installed but not on the PATH.
  • XAMPP keeps its own copy of PHP. The XAMPP Shell, the htdocs folder and the xampp\php folder each give you a way to read it. Apache Friends offers XAMPP for Windows with PHP 8.3.36 on its home page, checked 13 November 2026.
  • Delete the phpinfo file when you are done. It lists settings that you do not want left on a server.
  • Local PHP is not live PHP. The number on your PC tells you nothing about the host that serves your visitors. Check both.
  • Support dates matter. The php.net supported versions page lists branches 8.2, 8.3, 8.4 and 8.5, checked 13 November 2026. A 7.4 result means you are far behind.

Method 1: Command Prompt on Windows 11

This works if PHP is installed and its folder is on your PATH.

  1. Press the Windows key, type cmd and open Command Prompt.
  2. Type php -v and press Enter.
  3. Read the first line. It starts with PHP, then the version, then (cli).

The PHP manual says the -v and --version options print the version together with the name of the interface in use. That interface is the command line one, which is why you see cli.

For more than the number, the manual describes php -i, which prints the same details as a phpinfo page.

Method 2: PowerShell

The command is the same. Right click the Start button, pick Terminal (on Windows 11 this opens PowerShell by default on most setups), and run php -v. If you want to know where the file lives, use these two:

  • In Command Prompt, where php prints the full path of each php.exe it can find.
  • In PowerShell, Get-Command php shows the same thing.

Two paths on the list explain a surprising number. Windows uses the first one it finds.

How to check if PHP is installed on Windows

Windows has no built in PHP. Work down this list.

  1. Run php -v. A version line means PHP is installed and reachable.
  2. If you get an error, run where php. A path means it is on your PATH after all, and something else is wrong.
  3. Look for a folder by hand. Common places are C:\xampp\php and a plain C:\php. If php.exe sits in either, PHP is installed and only the PATH is missing.
  4. Look in the Start menu for XAMPP, WampServer or Laragon. Those tools carry their own PHP.
  5. If nothing turns up, PHP is not installed on this PC.

You do not need PHP on your computer to run a live website. Your host has its own.

What "php is not recognized" means

The full message in Command Prompt reads that php is not recognized as an internal or external command, operable program or batch file. PowerShell words it differently but means the same: it does not know the name php.

Windows looks for programs in a list of folders called the PATH. If the folder holding php.exe is not on that list, typing php finds nothing. There are two fixes.

Quick fix for one window. Run the PHP file by its full path, for example C:\xampp\php\php.exe -v. Swap the folder for wherever your php.exe lives.

Lasting fix. The PHP manual's installation FAQ gives this route, here in order:

  1. Open the system settings and find Environment Variables (under the Advanced tab).
  2. Under System variables, double click Path.
  3. Add the folder that contains php.exe to the end of the list, for example C:\php.
  4. Click OK. The manual says to restart so that it takes effect. Closing and reopening your terminal window is often enough, though a restart is the safe route.

Windows 11 uses a newer layout, so search the Start menu for "environment variables" if you cannot find the old route. Add the folder, never the file itself.

Checking PHP in XAMPP

Apache Friends describes XAMPP as a free Apache distribution holding MariaDB, PHP and Perl, and its own FAQ says it is meant for development, not for running a public site. It installs into C:\xampp by default for the ZIP version, per the same FAQ. There are three ways to read the version.

The XAMPP Shell

  1. Open the XAMPP Control Panel (xampp-control.exe in the XAMPP folder).
  2. Click Shell on the right side.
  3. In the window that opens, type php -v.

The shell starts with XAMPP's own PHP ready, so it avoids the "not recognized" problem.

A phpinfo file in htdocs

The Apache Friends FAQ says htdocs is the main folder for web content, and that a file such as test.php placed there is served at http://localhost/test.php. Use that to build a version page.

  1. Start Apache from the Control Panel.
  2. Open the htdocs folder inside your XAMPP folder.
  3. Create a file named phpinfo.php with one line:
  4. Open http://localhost/phpinfo.php in your browser.
  5. Read the PHP version at the top of the page, then find the line called Loaded Configuration File to see which php.ini is in use.
  6. Delete phpinfo.php when you are finished.

Why delete it? The page prints your configuration, paths and loaded extensions. On your own PC that is harmless, but files in htdocs get copied to live servers, and a forgotten phpinfo page shows an attacker what to aim at. The same FAQ lists weak XAMPP defaults, such as a MySQL root user with no password.

The php.exe path

Open C:\xampp\php\ in File Explorer. The same folder holds php.ini, according to the FAQ. In the address bar type cmd and press Enter to open a Command Prompt right there, then run php -v. This is the same php.exe that Apache uses for your local pages.

Which method to use

SituationBest methodShows
PHP on your PATH, quick lookphp -v in Command Prompt or PowerShellVersion and interface
Not sure which copy runswhere php or Get-Command phpEvery php.exe found
Using XAMPPShell button in the Control PanelXAMPP's own version
Need settings as well as the versionphp -i or a phpinfo fileFull configuration
Error says not recognizedFull path to php.exe, then the PATH fixThe version, once found

Local PHP and live host PHP are separate

This is the part most guides skip. Your Windows PC and your web host each run their own PHP, and the two numbers usually differ. Your site's visitors only ever meet the host's one.

That gap causes real trouble. A plugin that runs fine on your XAMPP copy might throw a fatal error on the live server. When Apache Friends shows XAMPP for Windows with PHP 8.3.36, as it did on 13 November 2026, that only says what XAMPP gives you. It says nothing about your hosting plan.

To read the live number, use a method that runs on the server:

Try to keep your local PHP on the same branch as the live host, or one step ahead. Before you raise the host's version, rehearse it on a copy, as in our post on testing a PHP update on a staging site.

What your version number means

Once you have the number, compare it with the php.net supported versions page, which we read on 13 November 2026.

BranchActive support untilSecurity support until
8.231 Dec 202431 Dec 2026
8.331 Dec 202531 Dec 2027
8.431 Dec 202631 Dec 2028
8.531 Dec 202731 Dec 2029

The page lists only these four branches. Anything older, such as 7.4, 8.0 or 8.1, is not in the table at all. php.net's end of life page gives 28 November 2022 for 7.4, 26 November 2023 for 8.0 and 31 December 2025 for 8.1. Our guide to PHP end of life dates explains what to do in each case.

For Elementor users, 7.4 matters. Elementor's requirements page says the builder works with PHP 7.4 or greater, and that it highly recommends PHP 8.3 or newer (checked 13 November 2026). So 7.4 is the stated floor, yet no longer gets updates. Read more in our post on Elementor and the PHP version, and on what WordPress itself requires. The latest security news is in our PHP vulnerability guide.

This is general information, not security advice. For the current word on any release, use php.net.

When this guide does not apply

  • You only run a hosted site and never build locally. Skip Windows and XAMPP completely. Use Site Health or your host's panel.
  • You use Webflow, Shopify, Wix or Squarespace. Those platforms do not expose a PHP version for you to change. Our post on whether Webflow runs PHP covers that case.

How we help at Amariq

Plenty of WordPress trouble starts with a mismatch nobody noticed. When we take on a WordPress job, we write down the PHP version in each place, so the build, the test copy and the final site all agree before launch. We also plan a safe path off any branch that is out of support. Our WordPress development service covers the build, the update and a clean handover. We price from the scope of the work, never by the hour, and the design, copy and code are yours after the final payment. See WordPress development.

Frequently asked questions

How do I check my PHP version in Windows 11?

Open Command Prompt or PowerShell and run php -v. The first line shows the version. If Windows says php is not recognized, PHP is either missing or not on your PATH, so follow the steps above.

How do I check if PHP is installed on Windows?

Run php -v, then where php if that fails. If neither works, look in C:\xampp\php and C:\php for a php.exe file. If you find no file at all, PHP is not installed. Windows does not ship with it.

How do I check my PHP version in XAMPP?

Open the XAMPP Control Panel, click Shell and type php -v. You can also run a phpinfo file from htdocs or open Command Prompt inside C:\xampp\php. Delete any phpinfo file afterwards.

Why does php -v say it is not recognized?

Windows cannot find php.exe in any folder on its PATH. Run the file by its full path to confirm PHP works, then add its folder to the PATH in Environment Variables and open a fresh terminal.

What version of PHP does Elementor support?

Elementor's requirements page says it works with PHP 7.4 or greater and highly recommends 8.3 or newer. That was the wording on 13 November 2026. Since 7.4 is out of support, aim for a current branch on the live host.

Is PHP 7.4 still supported?

No. php.net's end of life page gives 28 November 2022 as the end date for the 7.4 branch, and the supported versions page now lists only 8.2 to 8.5. Move to a listed branch after testing on a copy of your site.

Does my XAMPP version tell me what my live host runs?

No. XAMPP runs on your own computer and your host runs its own PHP. Check your live version in WordPress Site Health or your hosting panel, and compare the two.

Should I leave the phpinfo file on my site?

No. Delete it after you read the version. It prints server settings and paths that help an attacker, and it should never be left on a public site or in a folder you may later upload.

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