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

🌐
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.
Discussions

How to check PHP version?
The URL given is one that works with the script they provide or expect you to write. There's no built-in "magic URL" to show that information with PHP. A HTML page of configuration information can be generated in PHP code using phpinfo() You may also want to pay attention to the top section of phpinfo() output that lists the ini files read, to make sure you're editing the right files. This same information is available on the command line through the following commands: php -i (full information similar to phpinfo()) php -m (enabled modules / extensions) php -v (version) php --ini (ini files read) See also php --help for more command-line options. Note that you can also set most ini settings at runtime in a script using ini_set() . In this specific case see also the error_reporting() function. More on reddit.com
🌐 r/PHPhelp
6
1
November 4, 2023
How to Uninstall PHP in Windows 10
Just to let you know: you can download and install mysql as well. More on reddit.com
🌐 r/PHPhelp
6
3
December 8, 2017
🌐
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 that, Type ‘cmd’ in it & press ‘Enter.’ This will open the Command Prompt window. ➔ Once it is open, type the following command and press ‘Enter’: After running the above command, you will see output like this: As shown in the image, PHP 8.1.33 is the installed version.
🌐
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 have command line access on the server on which PHP is installed, you can check the PHP version using the command php -v. If the server is remote, you may need to SSH in. First, open your command line interface: Windows Command Prompt: ...
🌐
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 - 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.
🌐
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.

Find elsewhere
🌐
Benjamin Crozat
benjamincrozat.com › home › blog › check php version: command line and browser methods
6 ways to check your version of PHP in 2025 - Benjamin Crozat
August 11, 2025 - If you cannot use the terminal, phpinfo(), phpversion(), and Laravel’s php artisan about command are the next easiest options. This method works perfectly on macOS, Linux, Windows, and WSL.
🌐
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 - However, to use the user must have access to the Windows command line apps like CMD. ... Go to Windows 10 or 11 search box and type CMD or Powershell. You can use any of them. As the icon appears on any of these tools, click on it to run.
🌐
How To Check Version
howtocheckversion.com › check-php-version-running
How to check what PHP version I am running – How To Check Version
September 28, 2023 - php -v is also working on Windows platforms. You can just start your CMD and run it to see the PHP version you currently have installed.
🌐
Cyfuture Cloud
cyfuture.cloud › kb › general › how-do-i-check-php-version-and-configuration
How Do I Check PHP Version And Configuration?
Copy code PHP 8.1.0 (cli) (built: ... Prompt: Press Win + R, type cmd, and hit Enter. Run the PHP Version Command: bash Copy code php -v ·...
🌐
Finxter
blog.finxter.com › check-php-version
Check PHP Version – Be on the Right Side of Change
Press Win + R keys, type cmd, and hit Enter to open Command Prompt. Type php -v and press Enter. The PHP version, build date, and copyright information will be displayed. Remember that the php -v command only works if PHP is installed and added to the system’s PATH variable.
🌐
King Koil India
matseotools.com › blog › how-to-check-php-version-in-cmd-quick-easy-stepbystep-guide
How to Check PHP Version in CMD: Quick & Easy Step-by-Step Guide
January 7, 2026 - It also helps you avoid security ... Open your command prompt (on Windows) or terminal (on Mac/Linux) and type php -v or php --version, then press Enter....
🌐
Codecourse
codecourse.com › articles › how-to-check-your-php-version-3-ways
How to Check Your PHP Version (3 Ways)
September 19, 2024 - Another way to do this is by running php -i' which will dump the information about your PHP installation.
🌐
YouTube
youtube.com › watch
How to CHECK PHP Version in CMD (Step by Step) 2025 - YouTube
Need to verify which version of PHP is installed on your system? This step-by-step tutorial shows you how to check your PHP version using Command Prompt (CMD...
Published   April 7, 2025
🌐
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
🌐
Textawin
textawin.com › home › blog › how to check php version in cmd​
How to Check PHP Version in CMD? Simple Guide Updated 2025!
August 4, 2025 - Press Win + R, type cmd, and hit Enter. The Command Prompt window will open. 📟 ... If PHP is installed correctly, you’ll see an output similar to: PHP 8.1.2 (cli) (built: Jan 20 2023 10:20:30) ( ZTS Visual C++ 2019 )
🌐
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 - A Detailed Guide Explaining How to Verify the PHP Version on Your Server, Utilizing Either the Command Line Interface or a PHP File.
🌐
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.
🌐
Simplified
simplified.guide › php › check-version
How to check PHP version
There are several ways to check the PHP version on your system. You can use the command line or execute specific PHP functions in your code.