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.
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 can I fix which version of Windows PHP is being used for the CLI? - Stack Overflow
I have WAMPServer 3.0.6 with PHP 7.0.10 Installed. I use Git Bash to use server side cli for my projects, mainly Laravel. There's a package that needs PHP 7.0 to work and even tought my WAMP Server... More on stackoverflow.com
🌐 stackoverflow.com
Microsoft not going to officially support PHP 8 and beyond?
For some possibly missing context, Microsoft runs https://windows.php.net and produces all the official builds of PHP for Windows. If you run `php.exe`, or `mod_php7.dll` or whatever the websapi versions are actually called, then you either use Microsoft's own builds of PHP or you're compiling it yourself. This message means Microsoft aren't going to produce official builds for PHP 8 onwards. This message does NOT mean that nobody will. Most likely the project will dust off a machine somewhere in the cloud running Windows (likely using a free license generously provided by MS, btw) and setup some automated build processes to make these "in house". These machine(s) may even be setup/maintained by the same people who were doing the official builds at Microsoft (such as cmb who is also one of the 7.3 RMs). We're still in initial reaction phase here, but the bottom line is there will likely be very little change for Windows users. More on reddit.com
🌐 r/PHP
89
106
May 30, 2020
How to install PHP 7.3 on Windows 10
Is it for development? Then take the easy way out and use something like XAMPP . You can easily install and swap between multiple versions of PHP, which you can get from https://www.php.net/downloads.php Don't even try using Docker on Windows unless you have Pro, and even then it's a bother. And installing PHP directly is an unnecessary hassle, unless you intend to use it as a production server. Edit: Though if you intend to develop something important there, and need environment normalization, I recommend using Vagrant for virtualization. It takes up a lot of space, but it's worth it to make sure your code will run where you deploy it. But for small hobby projects, I wouldn't call it necessary. More on reddit.com
🌐 r/PHPhelp
8
3
February 16, 2020
🌐
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
6 ways to check your version of PHP in 2025 - Benjamin Crozat
August 11, 2025 - 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
Guide 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.
Find elsewhere
🌐
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 ...
🌐
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.🖥️
🌐
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 14, 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?
🌐
Envato Tuts+
code.tutsplus.com › tutorials › how-to-check-the-php-version--cms-35322
How to Check the PHP Version - Code
July 30, 2020 - 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...
🌐
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.