Installing XAMPP
Download XAMPP Installer for WIndows and install with default settings.
If you get a warning in XAMPP saying Skype is using port 80, do the following:
- Stop all services and quit XAMPP
- Open Skype
- Tools -> Options -> Advanced settings -> Connection
- Uncheck “Use port 80 and 443 as alternatives”
- Run XAMPP as administrator
Setting up virtual hosts
- Stop all services in XAMPP
- Open Apache vhostsfile located at:C:\xampp\apache\conf\extra\httpd-vhosts.conf
- First add a default virtual host buy adding the following code to the end of the file
<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs"
    ServerName localhost
</VirtualHost>
This will stop the URL http://localhost/ from redirecting to the first real virtual host we create. This is handy when you need to access a URL like http://localhost/newsite/wp/wp-admin to install WordPress etc.
- Next  follow the examples in the vhostsfile and add this code to the end of the file after our default virtual host.
<VirtualHost *:80>
    ServerAdmin postmaster@bp.benpearson
    DocumentRoot "C:/xampp/htdocs/benpearson"
    ServerName bp.benpearson
    ServerAlias www.bp.benpearson
    ErrorLog "logs/bp.benpearson-error.log"
    CustomLog "logs/bp.benpearson-access.log" combined
</VirtualHost>
This code will create a virtual host for bp.benpearson
- Create the folder C:/xampp/htdocs/benpearsonand put a testindex.htmlin there.
- Run notepad as an administrator
- Open the Windows hostsfile located at:C:\Windows\System32\drivers\etc\hosts(may need to select “All Files” to see thehostsfile in theetcdirectory)
- Add the following line to the bottom of the file (the space after the IP address should be a tab) :
127.0.0.1 bp.benpearson
- Start XAMPP Apache service.
- Go to bp.benpearsonin a browser and you should see your testindex.html.
Reference: How to set up XAMPP with virtual hosts (some instructions conflict with the above)
Hi Ben,
I go through this tutorial and everything is fine. After finish the work I have run the from my browser. I just give my url is “http://www.xml_api.dev”. When i enter into this in my browser its just redirect to “http://www.xml_api.dev/xampp/” . I’ve created “xml_api” folder in htdocs and also insert index.html.
All the time i give the url, it will redirect to http://www.xml_api.dev/xampp/. How to get rid of this issue? I want show my index.html file in the folder xml_api in htdocs. Please help me
Very thank you, it’s work fine for me, this is very simple step.
Related information about updating/upgrading/reinstalling XAMPP on Windows: https://community.apachefriends.org/f/viewtopic.php?p=175157
Hi my name is Daniel, I am newbie in wordpress I want to learn and experience the trending of web editing. after setting all this stuff installing xampp, how I will run wordpress, please it would be my credit to you sir for your kindness and reaching those people who is in need your knowledge specially in the field of computer world. please teach me. my email is danwise35@yahoo.com
Hi Daniel. Try teamtreehouse.com or tutsplus.com or the Lodge on css-tricks.com. They have everything you need. Good luck.