Zend Framework: The requested URL /newposter was not found on this server.

Problem:PHP zend framework The requested URL /XXX/public/index was not found on this server 

把根目录指向zend framework中的public目录,因为没有view,直接用Debug Url调试controller和action,一直报“Zend The requested URL /newposter was not found on this server.”这样的错误。

1、首先确定了我的VirtualHost"iphone.com"能够使用。

2、在Controller里面确实存在该action。

3、在httpd-vhosts.conf文件中虚拟主机iphone.com开启了“AllowOverride All”,允许所有具有".htaccess"作用域的指令都允许出现在.htaccess文件中。

4、httpd-vhosts.conf通过在httpd.conf中的“Inlcude /extra/httpd-vhosts.conf”选线启用,打开httpd.conf文件可以发现下面的AllowOverride的选项。

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>
#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "D:\Program Files\Zend\Apache2/htdocs">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride None
    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all
</Directory>

中的AllowOverride为None,直接改为All,重启Appache服务器,能正常访问页面。

参考资料:百度百科--AllowOverride:http://baike.baidu.com/view/9411222.htm

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值