Put this in your root directory:

<?php
phpinfo();
?>

Save it as phpinfo.php and point your browser to it (this could be http://localhost/phpinfo.php)

  • More information (you can get much more information than just the version).
  • Example (random image):

Answer from Rinzwind on askubuntu.com
๐ŸŒ
IIT Kharagpur
facweb.iitkgp.ac.in โ€บ dashboard โ€บ docs โ€บ use-different-php-version.html
Use a Different PHP Version
The new version of PHP should now be active. To verify this, browse to the URL http://localhost/xampp/phpinfo.php, which displays the output of the phpinfo() command, and check the version number at the top of the page.
๐ŸŒ
PhoenixNAP
phoenixnap.com โ€บ home โ€บ kb โ€บ sysadmin โ€บ how to check php version
How to Check PHP Version | phoenixNAP KB
December 9, 2025 - In this tutorial, you will learn how to check your PHP version on a local machine, server, or WordPress website.
๐ŸŒ
Apache Friends
community.apachefriends.org โ€บ board index โ€บ xampp in english (language english only!) โ€บ xampp for windows
XAMPP Control Panel should show XAMPP version. - Apache Friends Support Forum
You can check the PHP version for a running XAMPP Apache by executing the PHPInfo Page from the XAMPP Dashboard. You can also check the PHP version by executing php -v in the XAMPP shell.
๐ŸŒ
Medium
medium.com โ€บ @divyesh__chotaliya โ€บ effortlessly-switching-xampp-php-versions-on-windows-d76b8e5237e7
How to Easily Manage PHP Versions in XAMPP on Windows | by Divyesh Chotaliya | Medium
September 26, 2024 - Install the new PHP version, which will be placed in the โ€œxamppโ€ folder. Verify each installation by checking the PHP version through the XAMPP Control Panel.
๐ŸŒ
TemplateToaster Blog
blog.templatetoaster.com โ€บ templatetoaster blog โ€บ tutorials โ€บ how to update change php version in xampp
How to Update Change PHP Version in XAMPP - TemplateToaster Blog
September 5, 2023 - After the download you need to extract it, and you will find php and apache folder in it. Now rename the apache folder that you can find in C:\xampp. Restart the apache and MySQL. Now you can check the pho version by using the command โ€œphp-vโ€.
Top answer
1 of 16
192

In command prompt type below

set PATH=%PATH%;C:\path\to\php

Where C:\path\to\php is the folder where your php.exe file is located. After this run

C:\>php -v

than you will see something like

PHP 7.3.6 (cli) (built: May 29 2019 12:11:00) 

UPDATE:

If you find that when you restart your computer, this solution will not work anymore:

Set the Path like as following:

Step 1 - Click on the Windows icon

Step 2 - Click on the Settings icon

Step 3 - Click on System

Step 4 - Click on About

Step 5 - Click on System info

Step 6 - Click on Advanced system settings

Step 7 - Click on Environment variables...

Step 8 - Select Path row and then click Edit

Step 9 - Click New and then click Browse, then in the next panel which will open you need to select the folder you want in the Path. For the initial premise of this guide i will add the folder C:\Users\NewFolderInPath

Note: Replace your PHP installed path(e.g:C:\Program Files\php) with the above path .

Step 10 - Click OK and click every OK button you will encounter to close every previous windows.

2 of 16
29

You just need to find out where is your PHP folder.

  • If you are using XAMPP or WAMP then you will see a php folder.
  • You just need to go into the php folder using your cmd using command

cd \xampp\php (FOR XAMPP)

cd \wamp\php (FOR WAMP)

  • And then just type in this command

php -v

  • Then you will see something like

PHP 5.6.11 (cli) (built: Jul 9 2015 20:55:40) Copyright (c) 1997-2015 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies

Find elsewhere
๐ŸŒ
Wikihow
wikihow.com โ€บ computers and electronics โ€บ software โ€บ web programming โ€บ how to check php version: 3 ways on windows, mac, & linux
How to Check PHP Version: 3 Ways on Windows, Mac, & Linux
December 3, 2025 - If you're planning to implement ... check the PHP version quickly by running a simple PHP file on your server, or by using the "php -v" command at the Windows, Mac, or Linux command line....
๐ŸŒ
Simplified
simplified.guide โ€บ php โ€บ check-version
How to check PHP version
php binary is available in default PATH variable for Ubuntu and other Linux variance if installed using the default package manager. You might need to use full path for the binary if it's manually installed or using other methods such as XAMPP for Windows.
๐ŸŒ
CopyProgramming
copyprogramming.com โ€บ howto โ€บ check-php-version-xampp
Php: Check php version xampp
June 15, 2023 - Open command prompt Locate directory using cd C:/Xampp/php Type command php -v You will get your php version details ... How to check your xampp version Code Example, how to check xampp version in windows. install php 5.6 in xampp. download older version of xampp.
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 55796110 โ€บ how-to-know-the-php-version-associated-with-particular-version-of-xampp-without โ€บ 55796580
How to know the php version associated with particular version of XAMPP without installing on windows 10? - Stack Overflow
I want to install magento2.3 on localhost windows ,but for that I need either of the following versions of php ~5.6.5|7.0.2|7.0.4|~7.0.6|~7.1.0 . which is not available in latest version of xampp...
๐ŸŒ
HAJARSABRANI
hajarsabrani.com โ€บ home โ€บ check php version in xampp
Check PHP Version in Xampp - HAJARSABRANI - Php version in Xampp
November 30, 2021 - Usually by default the directory is in C:xampphtdocs. This directory depends on where you installed Xampp the first time. ... If appropriate, the Php version information will appear as below. ... How to View Instagram Profile Visits can be done with the following...
๐ŸŒ
nixCraft
cyberciti.biz โ€บ nixcraft โ€บ howto โ€บ php โ€บ how to check php version
How to Check and Print PHP Version on Linux / Unix - nixCraft
April 9, 2024 - We can list packages as follows using the rpm command: $ rpm -qa | grep php If you are using Debian / Ubuntu Linux based system, type the following command to find out php version: $ dpkg --list | grep php Sample outputs indicating PHP installed ...
๐ŸŒ
Zen-cart
zen-cart.com โ€บ showthread.php โ€บ 228568-XAMPP-and-Different-PHP-Versions
v157 XAMPP and Different PHP Versions
Unzip the PHP versions into the correct folder. Under the XAMPP control panel, open httd-xampp.config file and add the following to the bottom of the file. Note how the versions are shown. you need to make four changes for each version as yours may be different.
๐ŸŒ
Danpros
danpros.com โ€บ post โ€บ how-to-upgrade-php-in-xampp
How to Upgrade PHP in XAMPP to PHP 8.4 - danpros.com
July 8, 2025 - Restart Apache from the XAMPP Control Panel. Check if Apache starts without errors. Open a PHP info page or run php -v in the command prompt to confirm the PHP version displays as 8.4.
๐ŸŒ
LinuxConfig
linuxconfig.org โ€บ home โ€บ how to check php version on ubuntu
How to check PHP version on Ubuntu
September 22, 2020 - What if we want a little more in depth information? You can start a PHP interactive shell (again, from the command line) and use the phpinfo function.