Hi Reader, Here you will get to know how to set virtual host setup in XAMMP in Window. Basically when we are working on PHP development like framework Zend, Symphony we need to setup Virtual Host to project run in our localhost.
It’s very simple, within 2 min we can setup easily. follow the below step by step instructions to get this. In below example I set up gonetwork as my project folder in htdocs, so you can change according to your project folder name.
Step-1:
C:\xampp\apache\conf\extra — httpd-vhosts.conf
1 2 3 4 5 6 7 8 9 10 | <VirtualHost *:80> ServerName gonetwork.com DocumentRoot "C:/xampp/htdocs/gonetwork" <Directory "C:/xampp/htdocs/gonetwork"> DirectoryIndex index.php AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost> |
Step-2:
C:\Windows\System32\drivers\etc —
1 2 3 4 | # localhost name resolution is handled within DNS itself. 127.0.0.1 localhost #127.0.0.1 zend2f.com 127.0.0.1 gonetwork.com |
Step-3:
Restart your Apache Server now.
Run this project by name http://gonetwork.com in your local machine.
Similarly you can run your project http://your_project_folder.com
Hope this will help you out.