1.在 hosts文件添加ip和域名对应关系:
2.将httpd.conf中的Include conf/extra/httpd-vhosts.conf打开(去掉前头的#):
3.在httpd-vhosts.conf中添加以下内容,路径改一下:
<VirtualHost *:80>
ServerName www.swxtest.com
DocumentRoot "E:phpstudyswx"
<Directory "E:phpstudyswx">
Options Indexes FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
allow from all
Require all granted
DirectoryIndex index.php index.php3 index.html index.htm
</Directory>
</VirtualHost>
然后就可以了~: