4

XAMPP for Windows 1.8.2 PHP 5.4,操作系统:windows xp

我在 XAMPP 上使用用户名和密码

c:\windows\system32\drivers\etc\hosts 127.0.0.1 industans.local 127.0.0.1 read.local

E:\我的项目\wesites\读取index.html

httpd-vhosts.conf

    <Directory "E:/My Projects/wesites/read">
     Options Indexes FollowSymLinks
     AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>

  <VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs"
    ServerName localhost
  </VirtualHost>
   <VirtualHost *:80>
    DocumentRoot "E:/My Projects/wesites/read"
    ServerName read
    Options +Indexes
    </VirtualHost>

read.local 适用于 c:\xampp\htdocs 但 read.local 不适用于 E:\My Projects\wesites\read\index.html

我想从 E:\My Projects\wesites\read 运行我的项目

4

1 回答 1

0

您需要将 ServerName 与您在 hosts 中的地址匹配并授予它权限

<VirtualHost *:80> DocumentRoot "E:/My Projects/wesites/read" ServerName read.local <Directory "E:/My Projects/wesites/read" > Options Indexes FollowSymLinks Includes ExecCGI Order allow,deny Allow from all </Directory> </VirtualHost>

然后尝试访问 read.local 上的站点。

更多信息在这里

于 2014-11-14T16:39:45.630 回答