zend framework 1.5.2
提示找不到页面,HTTP 400错误

解决方案 »

  1.   

    用Zend Studio 6.0 for eclipse + WAMP 2b
      

  2.   

    index.php 如下:<?php
    /**
     * My new Zend Framework project
     * 
     * @author  
     * @version 
     */set_include_path('.' . PATH_SEPARATOR . '../library' . PATH_SEPARATOR . './application/default/models/' . PATH_SEPARATOR . get_include_path());
    require_once 'Zend/Controller/Front.php';/**
     * Setup controller
     */
    $controller = Zend_Controller_Front::getInstance();
    $controller->setControllerDirectory('../application/default/controllers');
    $controller->throwExceptions(false); // should be turned on in development time 
    // run!
    $controller->dispatch();
    .htaccess 如下:RewriteEngine onRewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php
      

  3.   

    1.0以后的zf需要有默认的错误控制器和错误视图,如果你没有建立默认的这个控制器和视图会提示错误,可以调用helper禁止这个行为。不过看你描述的好像不是这个问题
      

  4.   

    RewriteRule !\.(js ¦ico ¦gif ¦jpg ¦png ¦css)$ index.php  根据那个所有的访问根据扩展名例外都会重定向inde.php http://127.0.0.1/html/index.php/index/test 当然可以http://127.0.0.1/html/12345.php/54321/test 应该也可以 呵呵 LZ继续进行到下一步会提示你 有错误的控制器 建立errorController.php和error/index.phtml后 会显示应用程序错误 404 文件不存在 呵呵
    这时候就可以根据需要 处理不同的路径
      

  5.   

    楼上说的是对的,我把整个项目放到www目录里就没问题,但是用Alias指向工作空间里的项目就不行,谁知道怎么解决?html.conf 如下:Alias /html/ "E:/Program Files/Zend/Zend Studio for Eclipse - 6.0.0/workspace/Music/html/" <Directory "E:/Program Files/Zend/Zend Studio for Eclipse - 6.0.0/workspace/Music/html/">
        Options Indexes FollowSymLinks
        AllowOverride all
        Order allow,deny
        Allow from all
    </Directory>
    httpd.conf 如下:...
    <Directory "F:/wamp/www/">    Options Indexes FollowSymLinks
        AllowOverride all
        Order Deny,Allow
        Deny from all
        Allow from 127.0.0.1</Directory>
    ...
    Include "F:/wamp/alias/*"
    ...
      

  6.   

    貌似用了Alias它就不会自己找index.php了http://127.0.0.1/html/index.php 正常http://127.0.0.1/html/ 无法找到