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

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

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 4, 2017
🌐
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: ...
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to check php version
How to Check PHP Version | phoenixNAP KB
December 9, 2025 - 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. This version is not necessarily the one that runs on hosted websites.
🌐
Codecourse
codecourse.com › articles › how-to-check-your-php-version-3-ways
How to Check Your PHP Version (3 Ways)
September 19, 2024 - The terminal is the easiest way to check which PHP version you're running. This requires no code to be written, just a simple command. ... You'll get an output similar to the following. You'll notice that this gives the PHP version with (cli) appended. Crucially, this means the version of the CLI (command line interface) you're running and not necessarily the version you're running through your web server.
🌐
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 - Sometimes, running php -v may show an error like ‘php’ is not recognized as an internal or external command. This means PHP is either: ... Installed but not added to the Windows PATH environment variable.
🌐
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 - # Example command to navigate to the PHP installation location cd /usr/local/bin · After this, running php -v will correctly display the PHP version.
Find elsewhere
🌐
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 - 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). The installed PHP version will be displayed on the first line of the resulting page.
🌐
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 - Open the terminal prompt and then type the following commands. Login to the remote server using the ssh command. For example: ssh user@linux-unix-server-ip · To check PHP version, run: php --version OR php-cgi --version
🌐
Laravel Daily
laraveldaily.com › post › how-to-quickly-check-php-version-cli-nginx-laravel
How to Quickly Check PHP Version: CLI, NginX, Laravel
August 5, 2023 - Using the grep command, you can quickly identify each site's PHP version. ... From the socket in the output, we can see that they all run on PHP 8.1. /etc/nginx/sites-enabled/web1.test: fastcgi_pass unix:/opt/php/php8.1-fpm.sock; /etc/nginx...
🌐
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
🌐
Finxter
blog.finxter.com › check-php-version
Check PHP Version – Be on the Right Side of Change
To find the PHP version on your ... installation, including the version. 💻 · You can check the PHP version in the command line by running the command php -v....
🌐
Cyfuture Cloud
cyfuture.cloud › kb › general › how-do-i-check-php-version-and-configuration
How Do I Check PHP Version And Configuration?
When making decisions concerning updates, installs, and settings, these factors would be crucial for anybody creating applications, managing systems, or just managing websites. This tutorial will walk you through the process of using the command line to find the PHP version and 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
🌐
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 - So if this is your case you will have to locate php.exe on your system. The Main is located here: C:\xampp\php so I will run the set command using this path: Now run again php -v and you should see your PHP version.
🌐
sebhastian
sebhastian.com › check-php-version
How to check PHP version | sebhastian
July 20, 2022 - If you have access to the command line or terminal, then you can check your php version by running the php -v or php --version command. ... $ php -v PHP 8.1.5 (cli) (built: Apr 16 2022 00:03:58) (NTS) Copyright (c) The PHP Group Zend Engine ...
🌐
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 - Press Win + R, type cmd, then hit Enter. ... Open your Terminal application. Once your command prompt or terminal is open, type the following and press Enter: ... PHP 8.1.10 (cli) (built: Sep 19 2023 14:32:17) ( ZTS Visual C++ 2019 x64 ) Copyright ...
🌐
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 - If you’re using Windows, follow these steps to check your PHP version: 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) ...