0

我试图让 zf2 在我的 xampp 上运行。我有这个 vhosts.conf 文件

NameVirtualHost 127.0.0.1:80

<VirtualHost *:80>
  DocumentRoot "C:/xampp/htdocs"
  ServerName localhost
</VirtualHost>

<VirtualHost *:80>
    ServerName zf2-tutorial.localhost
    DocumentRoot "C:/xampp/htdocs/zf2-tutorial"    
    SetEnv APPLICATION_ENV "development"
    <Directory "C:/xampp/htdocs/zf2-tutorial">
        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all
    Require all granted
    </Directory>
</VirtualHost>

和这个主机文件

127.0.0.1   zf2-tutorial.localhost

现在,当我运行时zf2-tutorial.localhost,浏览器会转到zf2-tutorial.localhost/xampp并显示 xampp 页面。

当我跑步localhost时,它localhost/xampp也会去。

请帮忙。

4

1 回答 1

0

试试http://zf2-tutorial.localhost/public

如果可行,您可以更改 vhosts 文件中的以下条目

DocumentRoot "C:/xampp/htdocs/zf2-tutorial/public"    

<Directory "C:/xampp/htdocs/zf2-tutorial/public">
于 2013-08-08T16:43:50.227 回答