xampp和虚拟主机工作不正常

xampp和虚拟主机工作不正常,xampp,Xampp,我的虚拟主机设置如下所示: <VirtualHost *:8080> ServerName localhost DocumentRoot "D:\xampp\htdocs" <Directory "D:\xampp\htdocs"> DirectoryIndex index.php </Directory> </VirtualHost> <

我的虚拟主机设置如下所示:

<VirtualHost *:8080>
     ServerName localhost
     DocumentRoot "D:\xampp\htdocs"
     <Directory "D:\xampp\htdocs">
         DirectoryIndex index.php
     </Directory>
 </VirtualHost>

 <VirtualHost *:8080>
     ServerName mysite.site
     DocumentRoot "D:\xampp\htdocs\mysite"
     SetEnv APPLICATION_ENV "development"
     <Directory "D:\xampp\htdocs\mysite\public">
         DirectoryIndex index.php
         AllowOverride All
         Order allow,deny
         Allow from all
     </Directory>
 </VirtualHost>
但它实际上不起作用。我必须通过
localhost/mysite/public
才能工作。为什么?它不获取我的站点,而是加载我的localhost默认站点,即xampp的htdocs文件夹

编辑:
只是想补充一点,我已经在httpd.conf中包含了conf/extra/httpd vhosts.conf。

好的,我终于得到了这个。看起来我的端口不正确。我检查了
ServerName localhost:80
下的
httpd.conf
中使用的端口。然后我修复了我的虚拟主机设置:

 <VirtualHost *:80>
     ServerName mysite.site
     DocumentRoot "D:/xampp/htdocs/mysite/public"
     SetEnv APPLICATION_ENV "development"
     <Directory "D:/xampp\htdocs/mysite/public/">
         DirectoryIndex index.php
         AllowOverride All
         Order allow,deny
         Allow from all
     </Directory>
 </VirtualHost>

ServerName mysite.site
DocumentRoot“D:/xampp/htdocs/mysite/public”
SetEnv应用程序_ENV“开发”
DirectoryIndex.php
允许超越所有
命令允许,拒绝
通融
现在它工作了。:)

 <VirtualHost *:80>
     ServerName mysite.site
     DocumentRoot "D:/xampp/htdocs/mysite/public"
     SetEnv APPLICATION_ENV "development"
     <Directory "D:/xampp\htdocs/mysite/public/">
         DirectoryIndex index.php
         AllowOverride All
         Order allow,deny
         Allow from all
     </Directory>
 </VirtualHost>