配置虚拟主机: 1.hosts 域名配置 (C:WindowsSystem32driversetc下的hosts)文件末尾修改追加如下: 127.0.0.1 www.tp.com 2.开启虚拟主机配置:路径(C:xamppapacheconf下的httpd.conf文件 ) 504行, #Include conf/extra/httpd-vhosts.conf 去掉注释#号 开启 3.修改虚拟主机配置:路径(c:apache下的conf/extra/httpd-vhosts.conf文件末尾追加代码) <VirtualHost *:80> DocumentRoot “C:\xampp\htdocs\tp5\public” ServerName www.tp.com <Directory “C:\xampp\htdocs\tp5\public”> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost>系统文件hosts文件的修改C:WindowsSystem32driversetc 下的hosts2.tp5目录结构