How to run/execute php codes/scripts on windows 10?

         PHP is a scripting language that runs on server. It is most widely used to create dynamic and interactive webpages. You can also run on your PC/Laptop(i.e on Windows10). 

To run on your Windows 10 machine you need to follow the below steps.

1. Download the PHP from its official website.

       Under the VC9 x86 Non Thread Safe, download the zipped version and unzip it on your machine. (It can be downloaded on D:\ or E:\ or F:\ or any drive)

2. Go to unzipped folder, rename php.ini-production to php.ini

3. Open php.ini file in notepad and change cgi.force_redirect=0 and save this file.  (Before making a change it will be cgi.force_redirect=1)

4.Go to Control Panel\All Control Panel Items\Programs and Features, Turn Windows features on or off. Enable all the settings as shown below.

5. Type inetmgr in search box and open Internet Informaion Services (IIS) Manager. In this under Connections column(seen at top right of tool), expand MEGATRON-PC, expand Sites, select Default Web Site, now under Default Web Site Home(seen at top middle of tool), open Handler Mappings, now under Actions column(seen at top right of tool), open Add Module Mapping...
     Fill will below details,

       Request path: *.php
       Module: FastCgiModule
       Executable(Optional): Specify the path to php-cgi.exe present in your unzipped folder
       Name: PHP

6. Keep you PHP file at location C:\inetpub\wwwroot\filename.php

7. Run the script from browser as localhost/filename.php, which displays you with the output of your PHP script.