为什么无法在zend framework 1.12中查看我的项目

时间:2017-06-11 15:25:26

标签: php zend-framework xampp localhost host

我很震惊在这里,创建一个项目,项目名称是医学。

我正在使用xampp。我在http.conf中写道就像。

<VirtualHost *:8080>
   DocumentRoot "C:/xampp/htdocs/medicals/public"
   ServerName medicals.com

   # This should be omitted in the production environment
   SetEnv APPLICATION_ENV development

   <Directory "C:/xampp/htdocs/medicals/public">
       Options Indexes MultiViews FollowSymLinks
       AllowOverride All
       Order allow,deny
       Allow from all
   </Directory>

</VirtualHost>

并且,使用Windows path:C:\Windows\System32\drivers\etc指向。

127.0.0.1       medicals.com

我的浏览器在访问medicals.com时出错。

enter image description here

实际问题在哪里。我不明白。

提前谢谢。

2 个答案:

答案 0 :(得分:1)

复制以下代码:

<VirtualHost *:80>
     ServerName medicals.com
     DocumentRoot "C:/xampp/htdocs/medicals/public"
     SetEnv APPLICATION_ENV "development"
     <Directory "C:/xampp/htdocs/medicals/public">
         DirectoryIndex index.php
         AllowOverride All
         Require all granted
     </Directory>
 </VirtualHost>

要:

C:/xampp/apache/conf/extra/httpd-vhosts.conf

并添加以下内容:

127.0.0.1 medicals.com

C:/Windows/System32/drivers/etc

并确保您的mod_rewrite已启用,并且不要忘记在更改后重新启动Apache服务器。

这在zf3中对我有用。如果它在zf1中不起作用,您可能需要查看此内容。 https://framework.zend.com/manual/1.10/en/project-structure.rewrite.html

答案 1 :(得分:1)

请确认您的端口是80,如果您在xampp中使用另一个端口,您可以将行<VirtualHost *:80>更改为<VirtualHost *:8080>,8080是常用的端口号,您将8080更改为端口,

您的端口号显示在xampp控制面板PFA enter image description here