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
Windowsicon

Step 2 - Click on the
Settingsicon

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
Pathrow and then clickEdit

Step 9 - Click
Newand then clickBrowse, then in the next panel which will open you need to select the folder you want in thePath. For the initial premise of this guide i will add the folderC:\Users\NewFolderInPathNote: Replace your PHP installed path(e.g:
C:\Program Files\php) with the above path .

Step 10 - Click
OKand click everyOKbutton you will encounter to close every previous windows.

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
Windowsicon

Step 2 - Click on the
Settingsicon

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
Pathrow and then clickEdit

Step 9 - Click
Newand then clickBrowse, then in the next panel which will open you need to select the folder you want in thePath. For the initial premise of this guide i will add the folderC:\Users\NewFolderInPathNote: Replace your PHP installed path(e.g:
C:\Program Files\php) with the above path .

Step 10 - Click
OKand click everyOKbutton you will encounter to close every previous windows.

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
Videos
PHP does not have a running process when being invoked through apache. Instead, the PHP interpreter is executed for each apache request. To test if it is running, put
<?php phpinfo();
in a file named index.php and hit it in your browser.
If PHP is working, as it should with a default install of XAMPP, then you should see some information about your PHP installation on that page.
In a nutshell, apache will run php when it deems necessary (eg. when there's a new request). Try putting a script in C:\xampp\htdocs\mystuff (say, script.php) and go to //localhost/mystuff/script.php with your browser of preference — if it shows up, it's running as it should.
How can i know if PHP server is installed on my pc ?
Ask your system administrator. There are so many different servers that could support PHP, you'll have to ask someone who knows the machine you are dealing with.
and secondly i need a simple link where i can download it
http://php.net/
PHP is usually used in combination with a separate webserver. Apache is one of the more popular choices.
Judging by the .. emm ... structure of question, you are a primary OS is Windows. Instead of installing it on the existing system, you should consider using an virtualized server.
It is possible using VMware or VirtualBox to set up a server which runs on some distribution of linux or bsd. And it is possible to forward ports from the virtual OS to your localhost. This sort of solution also has the added benefit of simplifying the process of keeping it all up to date and it would give you a good reason for expanding you knowledge.
And then there is the fact, that you would not be polluting your main OS. You just turn the VM of, and its all gone. You have to also consider, that webserver might be accessible from outside. If you forget about having it , and there is a vulnerability found, it ming endanger your main OS. With virtual operating system there isn't such risk.
As "how" to know if you have server installed: check the task manager and the running services.
create a file (say info.php) with the following content on an accessible path and try to browse it:
<?php
phpinfo();
?>
@Alfabravo is correct: don't forget to delete the file from the server after using it!
Create a PHP script called php.php with the content:
<?php
phpinfo();
?>
and run it from your browser. Or from command line, run:
php -v