Credit to this website : https://www.sitepoint.com/how-to-install-apache-on-windows/
What is a Web Server?
A web server is software that listens for requests and returns data (usually a file). When you type “www.mysite.com”, the request is forwarded to a machine running web server software which returns a file back to your browser, e.g. the contents of index.html.
You can use your host’s web server for testing, but uploading will become tiresome and changes could go live before they had been fully tested. What you need is a local web server installation.
Why Apache?
In general, I would recommend using the web server software that your web host uses. Your host is likely to use Apache: the most widespread and fully-featured web server available. It is open-source project so it does not cost anything to download or install.
The following instructions describe how to install Apache on Windows.
All-in-One packages
There are some excellent all-in-one Windows distributions that contain Apache, PHP, MySQL and other applications in a single installation file, e.g. XAMPP, WampServer and Web.Developer. There is nothing wrong with using these packages, although manually installing Apache will help you learn more about the system and its configuration options.
Today, I going to show step by step on how to install the XAMPP in windows:
Step 1: Download the XAMPP Installer:
You can download the installer based on link : https://www.apachefriends.org/index.html
Step 2: Run as administrator:
Go to installer, and run as administrator. Click NEXT and NEXT. Finally, click FINISH.
Step 3: Start the Apache module:
On XAMPP Control Panel, click start to enable Apache.
Step 4: Check the whether XAMPP installed Succesffuly:
Open your web browser and type in the URL: http://localhost. If you are able to see the default page for XAMPP, you have successfully installed your XAMPP Server.
All the website realted files are organized in a folder called htdocs and then run index.php file by using http://localhost/index.php or http://localhost.
Step 5: Check the whether PHP is Working:
We create a folder inside htdocs folder. For example, I have create a folder named “ArinProject” and inside the folder have a few php file like ‘form_handling.php’ and ‘helloWorld.php’. So the root ‘URL’ of the website will be ‘http://localhost/ArinProject/’. So any home page is accessed by typing the root URL in the browser. To see the output, just type ‘http://localhost/ArinProject/form_handling.php’.
Step 6: Editor for write PHP file:
I suggest you used an editor named Sublime Text 3. It is really good editor with color code.