How PHP configures the virtual directory under Windows
1. First locate the Apache configuration file httpd.conf look for the following code:
# Virtual Hosts
#Include conf/extra/httpd-vhosts.conf
Remove # Include conf/extra/httpd-vhosts.conf #, as follows:
Include conf/extra/httpd-vhosts.conf
Save.
2. Open the httpd-vhosts.conf file under the Extra folder in the Apache conf directory, open it with Notepad, and add the following code at the end:
1
2ServerName Www.mydemo.
com
3DocumentRoot "D:/mydemo"
4
5
Options followsymlinks includesnoexec Indexes
6 directoryindex index.html index.htm
default. htm index.php
default. PHP index.cgi
default. CGI index.pl
default. PL index.
shtml
7
allowoverride Options FileInfo
8 Order Deny,
allow
9
One
3. Then to the C:->WINDOWS->SYSTEM32->DRIVERS->ETC directory, open the Hosts file.
Add the following code at the end:
1 127.0.0.1 www.mydemo.com
And then create the D:\mydemo directory
Then reboot the Apache server.
Look at the browser input www.mydemo.com