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 - Check your PHP version quickly on Windows 10 or 11 or add its folder as system variables to your PATH using our step-by-step guide.
Discussions

How to check if PHP is installed and detect the PHP Version – Okler Themes
Home › Forums › Resources › How to check if PHP is installed and detect the PHP Version This topic has 0 replies, 1 voice, and was last updated 10 years, 3 months ago by Support. This post has been viewed 31815 times Viewing 1… More on okler.net
🌐 okler.net
September 15, 2015
check php running on windows - Stack Overflow
I have installed XAMPP 1.7 on my windows 7. As expected, PHP is already included in this installer package. I look at XAMPP installed folder on my hard drive (C:\xampp) and it does have one folder... More on stackoverflow.com
🌐 stackoverflow.com
Check if PHP is installed on Apache or IIS Server? - Stack Overflow
Is there a way to check if PHP is installed on an Apache or IIS server within the PHP environment itself? If so, how? More on stackoverflow.com
🌐 stackoverflow.com
python - How to determine path to php.exe on Windows - search default paths - Stack Overflow
I'm currently developing a couple of plugins for Sublime Text 2 on OS X and I would like to make them cross platform, meaning I have to find out if and where php.exe is installed. Right now I call ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
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 - Type php -v and press ↵ Enter or ⏎ Return. When you run the command, the installed version of PHP will be displayed. If you get the error "PHP is not recognized" on Windows, jump to this Windows PHP fix.
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to check php version
How to Check PHP Version | phoenixNAP KB
December 9, 2025 - Press Enter to open the System Properties Window. 2. In System Properties, click the Environment Variables... button. 3. Find the System variables section and scroll down the list until you find the PATH variable. Select the PATH variable and click Edit: 4. Click the New button and enter the path to your PHP installation path.
🌐
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 - ➔ 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. Sometimes, running php -v may show an error like ...
🌐
YouTube
youtube.com › tuts make
How to Check PHP version Windows CMD - YouTube
Open Windows Command Prompt or CMD, simply type php -v and press Enter to check which version of PHP you are running.#tutorial #guide#https://www.tutsmake.co...
Published   January 22, 2024
Views   1K
🌐
Okler Themes
okler.net › home › forums › resources
How to check if PHP is installed and detect the PHP Version – Okler Themes
September 15, 2015 - Home › Forums › Resources › How to check if PHP is installed and detect the PHP Version This topic has 0 replies, 1 voice, and was last updated 10 years, 3 months ago by Support. This post has been viewed 31815 times Viewing 1…
Find elsewhere
🌐
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
In addition to this, you will need a command prompt or terminal access. Check PHP Version Using Command Prompt or Powershell The best and easiest way to identify the installed PHP version is to use its command line tool.
🌐
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 ...
🌐
Textawin
textawin.com › home › blog › how to check php version in cmd​
How to Check PHP Version in CMD? Simple Guide Updated 2025!
May 1, 2023 - 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: ... ✔ Download and install PHP from php.net ✔ Use package managers like Homebrew (macOS) or APT/YUM (Linux) ✔ Ensure PHP is properly configured in your system path
🌐
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. "The relevant directory" refers to the directory where PHP is installed.
🌐
PHP
php.net › manual › en › install.windows.php
PHP: Installation on Windows systems - Manual
PHP can also be installed on Azure ... 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. (I'm running IIS5 on W2K server. I don't know about 2K3) PHP will not "take" the ...
🌐
ThoughtCo
thoughtco.com › what-version-of-php-running-2694207
Here's How to Check the Version of PHP You're Running
September 19, 2024 - Running a simple PHP file will not only tell you your PHP version but an abundance of information about all your PHP settings. Just put this single line of PHP code in a blank text file and open it on the server: ... Below is how to check the locally installed version of PHP. You can run this in Command Prompt in Windows or ...
🌐
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 - 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.
🌐
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).