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

🌐
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 ...
🌐
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.
🌐
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.
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to check php version
How to Check PHP Version | phoenixNAP KB
December 9, 2025 - ... The command outputs the PHP version number, build date, and copyright information. Note: If there is more than one PHP version installed on the server, the php -v command shows the default command-line interface (CLI) version.
🌐
php.cn
m.php.cn › home › common problem › how do i know if php is installed on windows?
How do I know if PHP is installed on Windows?-Common Problem-php.cn
Select Path from the System Variables area and click the Edit button for more options for use in Windows Add the path to the folder where PHP is installed. Finally , click the Browse button and navigate to the folder where PHP is located . Once you find the folder, select it and press the OK button. Now, open Command Prompt or PowerShell to run php -v Common commands that display version-related details. Another way to check the PHP version on Windows 11 or 10 is to use a line of code that will display all the necessary information, Includes extensions and their versions.
🌐
Okler Themes
okler.net › home › forums › resources
How to check if PHP is installed and detect the PHP Version – Okler Themes
5. Delete the file on your web server after you are done. You should be the only one seeing this information! Source: https://www.arclab.com/en/kb/php/how-to-check-php-installed-detect-php-version.html
🌐
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. This will not work if you do not include php.exe in the system path.
Find elsewhere
🌐
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
You should be the only one seeing this information! Run the phpinfo() script above. It contains much more information, like: ... Some web server are pre-configured to run e.g. php5 and php8 at the same time, to ensure compatibility with older scripts and CMS systems.
🌐
Finxter
blog.finxter.com › check-php-version
Check PHP Version – Be on the Right Side of Change
Access the file through your browser, and you’ll see a page with detailed information about your PHP installation, including the version. 💻 · 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 ...
🌐
PHP
php.net › manual › en › install.windows.php
PHP: Installation on Windows systems - Manual
PHP can also be installed on Azure App Services (aka Microsoft Azure, Windows Azure, or (Windows) Azure Web Apps). The Installation section of the frequently asked questions covers common installation and configuration issues that may be encountered. Learn How To Improve This Page • Submit a Pull Request • Report a Bug ... If you make changes to your PHP.ini file, consider the following.
🌐
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 - Windows: Open Command Prompt or PowerShell and run php -v from the relevant directory. "The relevant directory" refers to the directory where PHP is installed. Obviously, PHP commands can't be executed from a location where PHP isn't installed.
🌐
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 - Windows users, launch the command prompt and fire up php -v. Mac and Linux users, that is pretty much the same, except we call it terminal instead of command prompt. ... This is another useful function phpinfo() – Just create a one-line script ...
🌐
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.
🌐
ThoughtCo
thoughtco.com › what-version-of-php-running-2694207
Here's How to Check the Version of PHP You're Running
September 20, 2018 - Below is how to check the locally installed version of PHP. You can run this in Command Prompt in Windows or Terminal for Linux/macOS. ... PHP 5.6.35 (cli) (built: Mar 29 2018 14:27:15) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies · Given that you actually are running PHP on your web server, the most common reason for the version of PHP not showing up is if ...
🌐
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
September 2, 2023 - 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.
🌐
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 - Your PHP version will be displayed. If PHP is not found, install it using: sudo apt install php · If you’re facing issues while checking PHP, here are some quick fixes: ✔ Add PHP to system environment variables (Windows users) ✔ Check if PHP is installed by running: