【发布时间】:2014-04-06 10:50:49
【问题描述】:
我在 xamp (Windows) 中安装了 zend 框架 2,当我调用 http://localhost/zf2-tutorial/public/ 时可以访问它。我正在尝试使用httpd-vhosts.conf 使用以下配置设置虚拟主机
<VirtualHost *:80>
ServerName zf2-tutorial.localhost
DocumentRoot "D:/xampp/htdocs/zf2-tutorial/public"
SetEnv APPLICATION_ENV "development"
<Directory D:/xampp/htdocs/zf2-tutorial/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
并在主机文件中配置了127.0.0.1 zf2-tutorial.localhost。但是当我在浏览器中调用zf2-tutorial.localhost 时,我得到的只是http://zf2-tutorial.localhost/xampp/。我也尝试在httpd.conf 中添加它,结果仍然相同。请帮忙?
【问题讨论】:
-
您在编辑虚拟主机后是否重新启动了 Apache?
-
是的,我已经重新启动了 Apache 以及完整的系统重新启动
-
尝试在文件主机上添加一行 di windows: 127.0.0.1 zf2-tutorial.localhost 文件主机位于 C:\windows\System32\drivers\etc\hosts
-
是的,我也在我的主机文件中做了那个条目..
标签: php apache zend-framework zend-framework2 vhosts