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.

Answer from NullPoiиteя on Stack Overflow
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

🌐
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 - To see which version of PHP is installed, open a command prompt or terminal, type "php -v", then press Enter or Return. If you can't access the command line, you can createa quick script or WordPress.
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to check php version
How to Check PHP Version | phoenixNAP KB
December 9, 2025 - If you get an error that php is not recognized as internal or external command even though you have PHP installed, add PHP to the PATH environment variable. ... 1. Press the Windows key and type Environment variables.
🌐
Reddit
reddit.com › r/phphelp › how to check php version?
r/PHPhelp on Reddit: How to check PHP version?
November 4, 2023 -

hi, I'm new to PHP.

I want to change display_errors to On for debugging, but see many PHP versions installed.

I thought going to http://localhost/first/index.php?language=English&page=phpinfo would give me the version , but it just renders the regular index page.

Ty.

🌐
Benjamin Crozat
benjamincrozat.com › home › blog › check php version: command line and browser methods
Check PHP version: command line and browser methods
September 2, 2023 - To check your PHP version, run php -v in your terminal. The first line shows your current version immediately. If you cannot use the terminal, phpinfo(), phpversion(), and Laravel’s php artisan about command are the next easiest options.
🌐
Host IT Smart
hostitsmart.com › manage › knowledgebase › 465 › check-php-version-in-windows-cmd.html
How to Check PHP Version in Windows CMD?
September 4, 2025 - In this detailed guide, we will walk you through the step-by-step process of checking the PHP version in Windows CMD (Command Prompt) in a beginner-friendly manner.
🌐
Beyond GTA Inc.
beyondgta.com › post › the-impact-of-php-version-and-how-to-check-it
The Impact of PHP Version and How to Check it
May 21, 2024 - First, determine your environment. Linux: Open a terminal and run php -v from the relevant directory. Windows: Open Command Prompt or PowerShell and run php -v from the relevant directory.
🌐
H2S Media
how2shout.com › home › php › how to know if php is installed on windows?
How to know if PHP is installed on Windows? - H2S Media
March 6, 2023 - After finding the folder, select it and press the OK button. Now, open the command prompt or PowerShell to run the common php -v command for showing the version-related details. Another way to check the version of PHP on Windows 11 or 10 is ...
Find elsewhere
🌐
Simplified
simplified.guide › php › check-version
How to check PHP version
<?php echo PHP_VERSION_ID; //Sample output: 70403 ?> Print phpversion() output from PHP script.
🌐
Finxter
blog.finxter.com › check-php-version
Check PHP Version – Be on the Right Side of Change
You can check the PHP version in the command line by running the command php -v. This command works on Linux, macOS, Windows, and other supported systems, displaying the PHP version number, build date, and copyright information.🖥️
🌐
Envato Tuts+
code.tutsplus.com › tutorials › how-to-check-the-php-version--cms-35322
How to Check the PHP Version - Code
Whether you need to create an email form, add a shopping cart to your eCommerce store, or create a contact form with validation, there's a PHP script that's...
🌐
Code Boxx
code-boxx.com › home › 4 ways to check the php version (a quick guide)
4 Ways to Check The PHP Version (A Quick Guide)
November 13, 2023 - ... D:\>php -v PHP 8.2.4 (cli) (built: Mar 14 2023 17:54:25) (ZTS Visual C++ 2019 x64) Copyright (c) The PHP Group Zend Engine v4.2.4, Copyright (c) Zend Technologies · Windows users, launch the command prompt and fire up php -v.
🌐
Gcore
gcore.com › home › developers › how to check the php version
How to check your PHP version via CLI or PHP File | Gcore
April 8, 2025 - Inside this file, use the phpinfo() function: ... 3. In your web browser, navigate to https://your-server/phpinfo.php (be sure to replace “your-server” with your server’s IP address or domain name).
🌐
GoDaddy
godaddy.com › help › view-your-php-version-in-windows-hosting-16091
View your PHP version in Windows Hosting | Windows Hosting (Plesk) - GoDaddy Help US
You can check your PHP version directly through the Plesk panel. Go to your GoDaddy product page. Select Web Hosting, and next to the Windows Hosting account you want to use select Manage.
🌐
Edureka Community
edureka.co › home › community › categories › web development › php › find php version on windows command line
Find PHP version on windows command line | Edureka Community
June 13, 2022 - I wanted to know the version of my PHP by using the windows command, C:\> php -v But it ... or external command". Can someone help me with this?
🌐
Namecheap
namecheap.com › support › knowledgebase › article.aspx › 9397 › 2219 › how-to-check-php-version-and-configuration
How to check PHP version and configuration - Hosting - Namecheap.com
There, you will see the domain and the PHP version set up for it: Another way to check PHP version is PHPinfo() function, commonly used to check the current state of PHP configuration.
🌐
YouTube
youtube.com › shorts › aNZGY8iC5Mk
Check PHP Version CMD #check #php #windows #xampp #cmd #commandprompt - YouTube
#check #php #version #windows #xampp #cmd #command #line #prompt #commandpromptIn this video, I am going to show you how to check the php version using comma...
Published   January 22, 2024
🌐
PHP
php.net › manual › en › function.phpversion.php
PHP: phpversion - Manual
Returns a string containing the version of the currently running PHP parser or extension.
🌐
Arclab
arclab.de › kb › php › how-to-check-php-installed-detect-php-version.html
How to check if php is installed and how to detect the php Version
php is installed on most hosted Linux based web servers, but it's also available for Windows based web servers. 1. Create a text file, e.g. using notepad or any other text editor: <?php phpinfo(); ?> 2. Save the file as "version.php". Make sure, that the extension is .php (not .txt) 3.